From 273136ab2307ed8565a976348b88a006a0a0a5e4 Mon Sep 17 00:00:00 2001 From: Benjamin Gamard Date: Fri, 10 Nov 2017 23:43:35 +0100 Subject: [PATCH] Closes #152 closes #154: localize date and time format --- docs-web/src/main/webapp/Gruntfile.js | 2 +- docs-web/src/main/webapp/src/app/docs/app.js | 14 +- .../webapp/src/app/docs/controller/Footer.js | 6 +- docs-web/src/main/webapp/src/index.html | 1 + .../src/lib/angular.tmhDynamicLocale.js | 260 ++++++++++++++++++ .../webapp/src/locale/angular-locale_en.js | 143 ++++++++++ .../webapp/src/locale/angular-locale_fr.js | 125 +++++++++ .../webapp/src/locale/angular-locale_zh_CN.js | 125 +++++++++ docs-web/src/main/webapp/src/locale/en.json | 5 + docs-web/src/main/webapp/src/locale/fr.json | 5 + .../src/partial/docs/directive.auditlog.html | 2 +- .../src/partial/docs/document.edit.html | 9 +- .../webapp/src/partial/docs/document.html | 2 +- .../src/partial/docs/document.view.html | 8 +- .../webapp/src/partial/docs/settings.log.html | 2 +- .../src/partial/docs/settings.session.html | 4 +- .../src/partial/docs/settings.user.html | 2 +- 17 files changed, 697 insertions(+), 18 deletions(-) create mode 100644 docs-web/src/main/webapp/src/lib/angular.tmhDynamicLocale.js create mode 100644 docs-web/src/main/webapp/src/locale/angular-locale_en.js create mode 100644 docs-web/src/main/webapp/src/locale/angular-locale_fr.js create mode 100644 docs-web/src/main/webapp/src/locale/angular-locale_zh_CN.js diff --git a/docs-web/src/main/webapp/Gruntfile.js b/docs-web/src/main/webapp/Gruntfile.js index 9e51bcc7..7c282d9c 100644 --- a/docs-web/src/main/webapp/Gruntfile.js +++ b/docs-web/src/main/webapp/Gruntfile.js @@ -106,7 +106,7 @@ module.exports = function(grunt) { dist: { expand: true, cwd: 'src/', - src: ['**', '!**/*.js', '!*.html', '!**/*.less', '!**/*.css'], + src: ['**', '!**/*.js', '!*.html', '!**/*.less', '!**/*.css', 'locale/**'], dest: 'dist/' } }, diff --git a/docs-web/src/main/webapp/src/app/docs/app.js b/docs-web/src/main/webapp/src/app/docs/app.js index 0f72ac61..4d08b550 100644 --- a/docs-web/src/main/webapp/src/app/docs/app.js +++ b/docs-web/src/main/webapp/src/app/docs/app.js @@ -6,13 +6,15 @@ angular.module('docs', // Dependencies ['ui.router', 'ui.bootstrap', 'dialog', 'ngProgress', 'monospaced.qrcode', 'yaru22.angular-timeago', 'ui.validate', - 'ui.sortable', 'restangular', 'ngSanitize', 'ngTouch', 'colorpicker.module', 'ngFileUpload', 'pascalprecht.translate'] + 'ui.sortable', 'restangular', 'ngSanitize', 'ngTouch', 'colorpicker.module', 'ngFileUpload', 'pascalprecht.translate', + 'tmh.dynamicLocale'] ) /** * Configuring modules. */ -.config(function($locationProvider, $urlRouterProvider, $stateProvider, $httpProvider, RestangularProvider, $translateProvider, timeAgoSettings) { +.config(function($locationProvider, $urlRouterProvider, $stateProvider, $httpProvider, + RestangularProvider, $translateProvider, timeAgoSettings, tmhDynamicLocaleProvider) { $locationProvider.hashPrefix(''); // Configuring UI Router @@ -363,9 +365,11 @@ angular.module('docs', } // Configuring Timago - timeAgoSettings.overrideLang = $translateProvider.preferredLanguage(); timeAgoSettings.fullDateAfterSeconds = 60 * 60 * 24 * 30; // 30 days + // Configuring tmhDynamicLocale + tmhDynamicLocaleProvider.localeLocationPattern('locale/angular-locale_{{locale}}.js'); + // Configuring $http to act like jQuery.ajax $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; $httpProvider.defaults.headers.put['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; @@ -428,8 +432,8 @@ angular.module('docs', // Watch for the number of XHR running $rootScope.$watch(function() { return $http.pendingRequests.length > 0 - }, function(count) { - if (count == 0) { + }, function(loading) { + if (!loading) { $rootScope.ngProgress.complete(); } else { $rootScope.ngProgress.start(); diff --git a/docs-web/src/main/webapp/src/app/docs/controller/Footer.js b/docs-web/src/main/webapp/src/app/docs/controller/Footer.js index 272310c3..5daf0f3b 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/Footer.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/Footer.js @@ -3,7 +3,7 @@ /** * Footer controller. */ -angular.module('docs').controller('Footer', function($scope, $rootScope, Restangular, $translate, timeAgoSettings) { +angular.module('docs').controller('Footer', function($scope, $rootScope, Restangular, $translate, timeAgoSettings, tmhDynamicLocale, $locale) { // Load app data Restangular.one('app').get().then(function(data) { $scope.app = data; @@ -14,6 +14,10 @@ angular.module('docs').controller('Footer', function($scope, $rootScope, Restang $scope.currentLang = $translate.use(); timeAgoSettings.overrideLang = $scope.currentLang; localStorage.overrideLang = $scope.currentLang; + tmhDynamicLocale.set($scope.currentLang).then(function () { + $rootScope.dateFormat = $locale.DATETIME_FORMATS.shortDate; + $rootScope.dateTimeFormat = $locale.DATETIME_FORMATS.short; + }); }); // Change the current language diff --git a/docs-web/src/main/webapp/src/index.html b/docs-web/src/main/webapp/src/index.html index f76a131d..e0744c8f 100644 --- a/docs-web/src/main/webapp/src/index.html +++ b/docs-web/src/main/webapp/src/index.html @@ -34,6 +34,7 @@ + diff --git a/docs-web/src/main/webapp/src/lib/angular.tmhDynamicLocale.js b/docs-web/src/main/webapp/src/lib/angular.tmhDynamicLocale.js new file mode 100644 index 00000000..5f7ab05f --- /dev/null +++ b/docs-web/src/main/webapp/src/lib/angular.tmhDynamicLocale.js @@ -0,0 +1,260 @@ +/** + * Angular Dynamic Locale - 0.1.32 + * https://github.com/lgalfaso/angular-dynamic-locale + * License: MIT + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define([], function () { + return (factory()); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + factory(); + } +}(this, function () { +'use strict'; +angular.module('tmh.dynamicLocale', []).config(['$provide', function($provide) { + function makeStateful($delegate) { + $delegate.$stateful = true; + return $delegate; + } + + $provide.decorator('dateFilter', ['$delegate', makeStateful]); + $provide.decorator('numberFilter', ['$delegate', makeStateful]); + $provide.decorator('currencyFilter', ['$delegate', makeStateful]); + +}]) +.constant('tmhDynamicLocale.STORAGE_KEY', 'tmhDynamicLocale.locale') +.provider('tmhDynamicLocale', ['tmhDynamicLocale.STORAGE_KEY', function(STORAGE_KEY) { + + var defaultLocale, + localeLocationPattern = 'angular/i18n/angular-locale_{{locale}}.js', + nodeToAppend, + storageFactory = 'tmhDynamicLocaleStorageCache', + storage, + storageKey = STORAGE_KEY, + promiseCache = {}, + activeLocale, + extraProperties = {}; + + /** + * Loads a script asynchronously + * + * @param {string} url The url for the script + @ @param {function} callback A function to be called once the script is loaded + */ + function loadScript(url, callback, errorCallback, $timeout) { + var script = document.createElement('script'), + element = nodeToAppend ? nodeToAppend : document.getElementsByTagName("body")[0], + removed = false; + + script.type = 'text/javascript'; + if (script.readyState) { // IE + script.onreadystatechange = function () { + if (script.readyState === 'complete' || + script.readyState === 'loaded') { + script.onreadystatechange = null; + $timeout( + function () { + if (removed) return; + removed = true; + element.removeChild(script); + callback(); + }, 30, false); + } + }; + } else { // Others + script.onload = function () { + if (removed) return; + removed = true; + element.removeChild(script); + callback(); + }; + script.onerror = function () { + if (removed) return; + removed = true; + element.removeChild(script); + errorCallback(); + }; + } + script.src = url; + script.async = true; + element.appendChild(script); + } + + /** + * Loads a locale and replaces the properties from the current locale with the new locale information + * + * @param {string} localeUrl The path to the new locale + * @param {Object} $locale The locale at the curent scope + * @param {string} localeId The locale id to load + * @param {Object} $rootScope The application $rootScope + * @param {Object} $q The application $q + * @param {Object} localeCache The current locale cache + * @param {Object} $timeout The application $timeout + */ + function loadLocale(localeUrl, $locale, localeId, $rootScope, $q, localeCache, $timeout) { + + function overrideValues(oldObject, newObject) { + if (activeLocale !== localeId) { + return; + } + angular.forEach(oldObject, function(value, key) { + if (!newObject[key]) { + delete oldObject[key]; + } else if (angular.isArray(newObject[key])) { + oldObject[key].length = newObject[key].length; + } + }); + angular.forEach(newObject, function(value, key) { + if (angular.isArray(newObject[key]) || angular.isObject(newObject[key])) { + if (!oldObject[key]) { + oldObject[key] = angular.isArray(newObject[key]) ? [] : {}; + } + overrideValues(oldObject[key], newObject[key]); + } else { + oldObject[key] = newObject[key]; + } + }); + } + + + if (promiseCache[localeId]) { + activeLocale = localeId; + return promiseCache[localeId]; + } + + var cachedLocale, + deferred = $q.defer(); + if (localeId === activeLocale) { + deferred.resolve($locale); + } else if ((cachedLocale = localeCache.get(localeId))) { + activeLocale = localeId; + $rootScope.$evalAsync(function() { + overrideValues($locale, cachedLocale); + storage.put(storageKey, localeId); + $rootScope.$broadcast('$localeChangeSuccess', localeId, $locale); + deferred.resolve($locale); + }); + } else { + activeLocale = localeId; + promiseCache[localeId] = deferred.promise; + loadScript(localeUrl, function() { + // Create a new injector with the new locale + var localInjector = angular.injector(['ngLocale']), + externalLocale = localInjector.get('$locale'); + + overrideValues($locale, externalLocale); + localeCache.put(localeId, externalLocale); + delete promiseCache[localeId]; + + $rootScope.$applyAsync(function() { + storage.put(storageKey, localeId); + $rootScope.$broadcast('$localeChangeSuccess', localeId, $locale); + deferred.resolve($locale); + }); + }, function() { + delete promiseCache[localeId]; + + $rootScope.$applyAsync(function() { + if (activeLocale === localeId) { + activeLocale = $locale.id; + } + $rootScope.$broadcast('$localeChangeError', localeId); + deferred.reject(localeId); + }); + }, $timeout); + } + return deferred.promise; + } + + this.localeLocationPattern = function(value) { + if (value) { + localeLocationPattern = value; + return this; + } else { + return localeLocationPattern; + } + }; + + this.appendScriptTo = function(nodeElement) { + nodeToAppend = nodeElement; + }; + + this.useStorage = function(storageName) { + storageFactory = storageName; + }; + + this.useCookieStorage = function() { + this.useStorage('$cookieStore'); + }; + + this.defaultLocale = function(value) { + defaultLocale = value; + }; + + this.storageKey = function(value) { + if (value) { + storageKey = value; + return this; + } else { + return storageKey; + } + }; + + this.addLocalePatternValue = function(key, value) { + extraProperties[key] = value; + }; + + this.$get = ['$rootScope', '$injector', '$interpolate', '$locale', '$q', 'tmhDynamicLocaleCache', '$timeout', function($rootScope, $injector, interpolate, locale, $q, tmhDynamicLocaleCache, $timeout) { + var localeLocation = interpolate(localeLocationPattern); + + storage = $injector.get(storageFactory); + $rootScope.$evalAsync(function() { + var initialLocale; + if ((initialLocale = (storage.get(storageKey) || defaultLocale))) { + loadLocaleFn(initialLocale); + } + }); + return { + /** + * @ngdoc method + * @description + * @param {string} value Sets the locale to the new locale. Changing the locale will trigger + * a background task that will retrieve the new locale and configure the current $locale + * instance with the information from the new locale + */ + set: loadLocaleFn, + /** + * @ngdoc method + * @description Returns the configured locale + */ + get: function() { + return activeLocale; + } + }; + + function loadLocaleFn(localeId) { + var baseProperties = {locale: localeId, angularVersion: angular.version.full}; + return loadLocale(localeLocation(angular.extend({}, extraProperties, baseProperties)), locale, localeId, $rootScope, $q, tmhDynamicLocaleCache, $timeout); + } + }]; +}]).provider('tmhDynamicLocaleCache', function() { + this.$get = ['$cacheFactory', function($cacheFactory) { + return $cacheFactory('tmh.dynamicLocales'); + }]; +}).provider('tmhDynamicLocaleStorageCache', function() { + this.$get = ['$cacheFactory', function($cacheFactory) { + return $cacheFactory('tmh.dynamicLocales.store'); + }]; +}).run(['tmhDynamicLocale', angular.noop]); + +return 'tmh.dynamicLocale'; + +})); diff --git a/docs-web/src/main/webapp/src/locale/angular-locale_en.js b/docs-web/src/main/webapp/src/locale/angular-locale_en.js new file mode 100644 index 00000000..f794bab8 --- /dev/null +++ b/docs-web/src/main/webapp/src/locale/angular-locale_en.js @@ -0,0 +1,143 @@ +'use strict'; +angular.module("ngLocale", [], ["$provide", function($provide) { +var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; +function getDecimals(n) { + n = n + ''; + var i = n.indexOf('.'); + return (i == -1) ? 0 : n.length - i - 1; +} + +function getVF(n, opt_precision) { + var v = opt_precision; + + if (undefined === v) { + v = Math.min(getDecimals(n), 3); + } + + var base = Math.pow(10, v); + var f = ((n * base) | 0) % base; + return {v: v, f: f}; +} + +$provide.value("$locale", { + "DATETIME_FORMATS": { + "AMPMS": [ + "AM", + "PM" + ], + "DAY": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "ERANAMES": [ + "Before Christ", + "Anno Domini" + ], + "ERAS": [ + "BC", + "AD" + ], + "FIRSTDAYOFWEEK": 6, + "MONTH": [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + "SHORTDAY": [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ], + "SHORTMONTH": [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + "STANDALONEMONTH": [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + "WEEKENDRANGE": [ + 5, + 6 + ], + "fullDate": "EEEE, MMMM d, y", + "longDate": "MMMM d, y", + "medium": "MMM d, y h:mm:ss a", + "mediumDate": "MMM d, y", + "mediumTime": "h:mm:ss a", + "short": "M/d/yy h:mm a", + "shortDate": "M/d/yy", + "shortTime": "h:mm a" + }, + "NUMBER_FORMATS": { + "CURRENCY_SYM": "$", + "DECIMAL_SEP": ".", + "GROUP_SEP": ",", + "PATTERNS": [ + { + "gSize": 3, + "lgSize": 3, + "maxFrac": 3, + "minFrac": 0, + "minInt": 1, + "negPre": "-", + "negSuf": "", + "posPre": "", + "posSuf": "" + }, + { + "gSize": 3, + "lgSize": 3, + "maxFrac": 2, + "minFrac": 2, + "minInt": 1, + "negPre": "-\u00a4", + "negSuf": "", + "posPre": "\u00a4", + "posSuf": "" + } + ] + }, + "id": "en", + "localeID": "en", + "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} +}); +}]); diff --git a/docs-web/src/main/webapp/src/locale/angular-locale_fr.js b/docs-web/src/main/webapp/src/locale/angular-locale_fr.js new file mode 100644 index 00000000..55c6bb2b --- /dev/null +++ b/docs-web/src/main/webapp/src/locale/angular-locale_fr.js @@ -0,0 +1,125 @@ +'use strict'; +angular.module("ngLocale", [], ["$provide", function($provide) { +var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; +$provide.value("$locale", { + "DATETIME_FORMATS": { + "AMPMS": [ + "AM", + "PM" + ], + "DAY": [ + "dimanche", + "lundi", + "mardi", + "mercredi", + "jeudi", + "vendredi", + "samedi" + ], + "ERANAMES": [ + "avant J\u00e9sus-Christ", + "apr\u00e8s J\u00e9sus-Christ" + ], + "ERAS": [ + "av. J.-C.", + "ap. J.-C." + ], + "FIRSTDAYOFWEEK": 0, + "MONTH": [ + "janvier", + "f\u00e9vrier", + "mars", + "avril", + "mai", + "juin", + "juillet", + "ao\u00fbt", + "septembre", + "octobre", + "novembre", + "d\u00e9cembre" + ], + "SHORTDAY": [ + "dim.", + "lun.", + "mar.", + "mer.", + "jeu.", + "ven.", + "sam." + ], + "SHORTMONTH": [ + "janv.", + "f\u00e9vr.", + "mars", + "avr.", + "mai", + "juin", + "juil.", + "ao\u00fbt", + "sept.", + "oct.", + "nov.", + "d\u00e9c." + ], + "STANDALONEMONTH": [ + "janvier", + "f\u00e9vrier", + "mars", + "avril", + "mai", + "juin", + "juillet", + "ao\u00fbt", + "septembre", + "octobre", + "novembre", + "d\u00e9cembre" + ], + "WEEKENDRANGE": [ + 5, + 6 + ], + "fullDate": "EEEE d MMMM y", + "longDate": "d MMMM y", + "medium": "d MMM y HH:mm:ss", + "mediumDate": "d MMM y", + "mediumTime": "HH:mm:ss", + "short": "dd/MM/y HH:mm", + "shortDate": "dd/MM/y", + "shortTime": "HH:mm" + }, + "NUMBER_FORMATS": { + "CURRENCY_SYM": "\u20ac", + "DECIMAL_SEP": ",", + "GROUP_SEP": "\u00a0", + "PATTERNS": [ + { + "gSize": 3, + "lgSize": 3, + "maxFrac": 3, + "minFrac": 0, + "minInt": 1, + "negPre": "-", + "negSuf": "", + "posPre": "", + "posSuf": "" + }, + { + "gSize": 3, + "lgSize": 3, + "maxFrac": 2, + "minFrac": 2, + "minInt": 1, + "negPre": "-", + "negSuf": "\u00a0\u00a4", + "posPre": "", + "posSuf": "\u00a0\u00a4" + } + ] + }, + "id": "fr", + "localeID": "fr", + "pluralCat": function(n, opt_precision) { var i = n | 0; if (i == 0 || i == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} +}); +}]); diff --git a/docs-web/src/main/webapp/src/locale/angular-locale_zh_CN.js b/docs-web/src/main/webapp/src/locale/angular-locale_zh_CN.js new file mode 100644 index 00000000..0471b82b --- /dev/null +++ b/docs-web/src/main/webapp/src/locale/angular-locale_zh_CN.js @@ -0,0 +1,125 @@ +'use strict'; +angular.module("ngLocale", [], ["$provide", function($provide) { +var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; +$provide.value("$locale", { + "DATETIME_FORMATS": { + "AMPMS": [ + "\u4e0a\u5348", + "\u4e0b\u5348" + ], + "DAY": [ + "\u661f\u671f\u65e5", + "\u661f\u671f\u4e00", + "\u661f\u671f\u4e8c", + "\u661f\u671f\u4e09", + "\u661f\u671f\u56db", + "\u661f\u671f\u4e94", + "\u661f\u671f\u516d" + ], + "ERANAMES": [ + "\u516c\u5143\u524d", + "\u516c\u5143" + ], + "ERAS": [ + "\u516c\u5143\u524d", + "\u516c\u5143" + ], + "FIRSTDAYOFWEEK": 6, + "MONTH": [ + "\u4e00\u6708", + "\u4e8c\u6708", + "\u4e09\u6708", + "\u56db\u6708", + "\u4e94\u6708", + "\u516d\u6708", + "\u4e03\u6708", + "\u516b\u6708", + "\u4e5d\u6708", + "\u5341\u6708", + "\u5341\u4e00\u6708", + "\u5341\u4e8c\u6708" + ], + "SHORTDAY": [ + "\u5468\u65e5", + "\u5468\u4e00", + "\u5468\u4e8c", + "\u5468\u4e09", + "\u5468\u56db", + "\u5468\u4e94", + "\u5468\u516d" + ], + "SHORTMONTH": [ + "1\u6708", + "2\u6708", + "3\u6708", + "4\u6708", + "5\u6708", + "6\u6708", + "7\u6708", + "8\u6708", + "9\u6708", + "10\u6708", + "11\u6708", + "12\u6708" + ], + "STANDALONEMONTH": [ + "\u4e00\u6708", + "\u4e8c\u6708", + "\u4e09\u6708", + "\u56db\u6708", + "\u4e94\u6708", + "\u516d\u6708", + "\u4e03\u6708", + "\u516b\u6708", + "\u4e5d\u6708", + "\u5341\u6708", + "\u5341\u4e00\u6708", + "\u5341\u4e8c\u6708" + ], + "WEEKENDRANGE": [ + 5, + 6 + ], + "fullDate": "y\u5e74M\u6708d\u65e5EEEE", + "longDate": "y\u5e74M\u6708d\u65e5", + "medium": "y\u5e74M\u6708d\u65e5 ah:mm:ss", + "mediumDate": "y\u5e74M\u6708d\u65e5", + "mediumTime": "ah:mm:ss", + "short": "y/M/d ah:mm", + "shortDate": "y/M/d", + "shortTime": "ah:mm" + }, + "NUMBER_FORMATS": { + "CURRENCY_SYM": "\u00a5", + "DECIMAL_SEP": ".", + "GROUP_SEP": ",", + "PATTERNS": [ + { + "gSize": 3, + "lgSize": 3, + "maxFrac": 3, + "minFrac": 0, + "minInt": 1, + "negPre": "-", + "negSuf": "", + "posPre": "", + "posSuf": "" + }, + { + "gSize": 3, + "lgSize": 3, + "maxFrac": 2, + "minFrac": 2, + "minInt": 1, + "negPre": "-\u00a4", + "negSuf": "", + "posPre": "\u00a4", + "posSuf": "" + } + ] + }, + "id": "zh-cn", + "localeID": "zh_CN", + "pluralCat": function(n, opt_precision) { return PLURAL_CATEGORY.OTHER;} +}); +}]); diff --git a/docs-web/src/main/webapp/src/locale/en.json b/docs-web/src/main/webapp/src/locale/en.json index b9c57587..71866c63 100644 --- a/docs-web/src/main/webapp/src/locale/en.json +++ b/docs-web/src/main/webapp/src/locale/en.json @@ -328,6 +328,11 @@ }, "selecttag": { "typeahead": "Type a tag" + }, + "datepicker": { + "current": "Today", + "clear": "Clear", + "close": "Done" } }, "filter": { diff --git a/docs-web/src/main/webapp/src/locale/fr.json b/docs-web/src/main/webapp/src/locale/fr.json index d362175e..25c4eb10 100644 --- a/docs-web/src/main/webapp/src/locale/fr.json +++ b/docs-web/src/main/webapp/src/locale/fr.json @@ -328,6 +328,11 @@ }, "selecttag": { "typeahead": "Entrez un tag" + }, + "datepicker": { + "current": "Aujourd'hui", + "clear": "Vider", + "close": "Fermer" } }, "filter": { diff --git a/docs-web/src/main/webapp/src/partial/docs/directive.auditlog.html b/docs-web/src/main/webapp/src/partial/docs/directive.auditlog.html index 3834cf52..04bbcab8 100644 --- a/docs-web/src/main/webapp/src/partial/docs/directive.auditlog.html +++ b/docs-web/src/main/webapp/src/partial/docs/directive.auditlog.html @@ -1,6 +1,6 @@ - + - + diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.session.html b/docs-web/src/main/webapp/src/partial/docs/settings.session.html index 9790506d..96524b0d 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.session.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.session.html @@ -10,8 +10,8 @@ - - + + - +
{{ log.create_date | date: 'yyyy-MM-dd HH:mm' }}{{ log.create_date | date: $root.dateTimeFormat }} diff --git a/docs-web/src/main/webapp/src/partial/docs/document.edit.html b/docs-web/src/main/webapp/src/partial/docs/document.edit.html index 1d14be40..99f244b8 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.edit.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.edit.html @@ -40,8 +40,13 @@
- +
diff --git a/docs-web/src/main/webapp/src/partial/docs/document.html b/docs-web/src/main/webapp/src/partial/docs/document.html index 7ad4afa7..d4d5be8d 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.html @@ -64,7 +64,7 @@ -
{{ document.create_date | timeAgo: 'yyyy-MM-dd' }}
+
{{ document.create_date | timeAgo: dateFormat }}
diff --git a/docs-web/src/main/webapp/src/partial/docs/document.view.html b/docs-web/src/main/webapp/src/partial/docs/document.view.html index e9ccab0b..5c31f240 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.view.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.view.html @@ -41,7 +41,7 @@
diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.log.html b/docs-web/src/main/webapp/src/partial/docs/settings.log.html index a417918f..a39ac5c5 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.log.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.log.html @@ -10,7 +10,7 @@
{{ log.date | date: 'yyyy-MM-dd HH:mm' }}{{ log.date | date: dateTimeFormat }} {{ log.tag }} {{ log.message }}
{{ session.create_date | date: 'yyyy-MM-dd HH:mm' }}{{ session.last_connection_date | date: 'yyyy-MM-dd HH:mm' }}{{ session.create_date | date: dateTimeFormat }}{{ session.last_connection_date | date: dateTimeFormat }} {{ session.ip }} {{ user.username }}{{ user.create_date | date: 'yyyy-MM-dd' }}{{ user.create_date | date: dateFormat }}