]> source.dussan.org Git - nextcloud-server.git/commitdiff
Translate formatDate using jquery datepicker
authorscambra <sergio@entrecables.com>
Fri, 21 Sep 2012 06:33:26 +0000 (08:33 +0200)
committerscambra <sergio@entrecables.com>
Fri, 19 Oct 2012 11:56:19 +0000 (13:56 +0200)
core/js/js.js
core/l10n/l10n-de.php
core/l10n/l10n-en.php
core/l10n/l10n-es.php
core/templates/layout.user.php
lib/l10n.php

index ba8020c89edf9b98f2bf839cc08cd4520a167f21..c5e32f3c27821c8e4b81a9615a96acc1a098ae1f 100644 (file)
@@ -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();
 }
 
 /**
index d80c3beb2ba54dabc8f3c8da4cc471538ec242a6..77d35af493675c1b31eda4db7bf9b5e143aeff4b 100644 (file)
@@ -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',
index 6268214b50336b700bf69f74f61b1a4ad26d3267..9ee748bee23584d3cd6e442e52b56007431b29de 100644 (file)
@@ -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',
index 8798b24d62f0b8e2a77a501a7fffaaf2e8092bb9..13db2ec5d4c7b65b420fda570c6f174b03a451d9 100644 (file)
@@ -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',
index 92d47cc51f8fb333e83da47c0f10962b3a8a201c..1f16fdf7c6c38ac9eb473367444918db9d967f80 100644 (file)
@@ -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')) ?>;
index 72ac9e353d8bee8656aad634acf014b84739c347..18706e4b4a52d4f324eb7a3971bbfcd10e9fd7fb 100644 (file)
@@ -58,6 +58,7 @@ class OC_L10N{
         * Localization
         */
        private $localizations = array(
+               'jsdate' => 'dd.mm.yy',
                'date' => '%d.%m.%Y',
                'datetime' => '%d.%m.%Y %H:%M:%S',
                'time' => '%H:%M:%S',
@@ -223,6 +224,7 @@ class OC_L10N{
                                return strftime($this->localizations[$type], $data);
                                break;
                        case 'firstday':
+                       case 'jsdate':
                                return $this->localizations[$type];
                        default:
                                return false;