summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorscambra <sergio@entrecables.com>2012-09-21 08:33:26 +0200
committerscambra <sergio@entrecables.com>2012-10-19 13:56:19 +0200
commit41b597e179a694973c709613cdf41e2b379c8df9 (patch)
tree8a7b56ff789036722bf154d15cf9a68e5528aa2c /core
parenta24d8db4b25e99f92ebb2cb65a97672f39a2f85f (diff)
downloadnextcloud-server-41b597e179a694973c709613cdf41e2b379c8df9.tar.gz
nextcloud-server-41b597e179a694973c709613cdf41e2b379c8df9.zip
Translate formatDate using jquery datepicker
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js4
-rw-r--r--core/l10n/l10n-de.php1
-rw-r--r--core/l10n/l10n-en.php1
-rw-r--r--core/l10n/l10n-es.php1
-rw-r--r--core/templates/layout.user.php1
5 files changed, 5 insertions, 3 deletions
diff --git a/core/js/js.js b/core/js/js.js
index ba8020c89ed..c5e32f3c278 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -667,9 +667,7 @@ function formatDate(date){
if(typeof date=='number'){
date=new Date(date);
}
- var monthNames = [ t('files','January'), t('files','February'), t('files','March'), t('files','April'), t('files','May'), t('files','June'),
- t('files','July'), t('files','August'), t('files','September'), t('files','October'), t('files','November'), t('files','December') ];
- return monthNames[date.getMonth()]+' '+date.getDate()+', '+date.getFullYear()+', '+((date.getHours()<10)?'0':'')+date.getHours()+':'+((date.getMinutes()<10)?'0':'')+date.getMinutes();
+ return $.datepicker.formatDate(datepickerFormatDate, date)+' '+date.getHours()+':'+((date.getMinutes()<10)?'0':'')+date.getMinutes();
}
/**
diff --git a/core/l10n/l10n-de.php b/core/l10n/l10n-de.php
index d80c3beb2ba..77d35af4936 100644
--- a/core/l10n/l10n-de.php
+++ b/core/l10n/l10n-de.php
@@ -1,5 +1,6 @@
<?php
$LOCALIZATIONS = array(
+ 'jsdate' => 'dd.mm.yy',
'date' => '%d.%m.%Y',
'datetime' => '%d.%m.%Y %H:%M:%S',
'time' => '%H:%M:%S',
diff --git a/core/l10n/l10n-en.php b/core/l10n/l10n-en.php
index 6268214b503..9ee748bee23 100644
--- a/core/l10n/l10n-en.php
+++ b/core/l10n/l10n-en.php
@@ -1,5 +1,6 @@
<?php
$LOCALIZATIONS = array(
+ 'jsdate' => 'MM d, yy',
'date' => '%B %e, %Y',
'datetime' => '%B %e, %Y %H:%M',
'time' => '%H:%M:%S',
diff --git a/core/l10n/l10n-es.php b/core/l10n/l10n-es.php
index 8798b24d62f..13db2ec5d4c 100644
--- a/core/l10n/l10n-es.php
+++ b/core/l10n/l10n-es.php
@@ -1,5 +1,6 @@
<?php
$LOCALIZATIONS = array(
+ 'jsdate' => "d 'de' MM 'de' yy",
'date' => '%e de %B de %Y',
'datetime' => '%e de %B de %Y %H:%M',
'time' => '%H:%M:%S',
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 92d47cc51f8..1f16fdf7c6c 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -13,6 +13,7 @@
var oc_current_user = '<?php echo OC_User::getUser() ?>';
var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
var oc_requestlifespan = '<?php echo $_['requestlifespan']; ?>';
+ var datepickerFormatDate = <?php echo json_encode($l->l('jsdate')) ?>;
var dayNames = <?php echo json_encode(array((string)$l->t('Sunday'), (string)$l->t('Monday'), (string)$l->t('Tuesday'), (string)$l->t('Wednesday'), (string)$l->t('Thursday'), (string)$l->t('Friday'), (string)$l->t('Saturday'))) ?>;
var monthNames = <?php echo json_encode(array((string)$l->t('January'), (string)$l->t('February'), (string)$l->t('March'), (string)$l->t('April'), (string)$l->t('May'), (string)$l->t('June'), (string)$l->t('July'), (string)$l->t('August'), (string)$l->t('September'), (string)$l->t('October'), (string)$l->t('November'), (string)$l->t('December'))) ?>;
var firstDay = <?php echo json_encode($l->l('firstday')) ?>;