From b05a7329e1f5b7b22804c4424c2c43f8b48b39d0 Mon Sep 17 00:00:00 2001
From: Benoit Lavenier <benoit.lavenier@e-is.pro>
Date: Thu, 30 Apr 2020 19:37:12 +0200
Subject: [PATCH] [enh] About modal: format the build time using a formatter

---
 www/js/services/modal-services.js | 5 ++++-
 www/templates/modal_about.html    | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/www/js/services/modal-services.js b/www/js/services/modal-services.js
index fd024fff..9addebd0 100644
--- a/www/js/services/modal-services.js
+++ b/www/js/services/modal-services.js
@@ -6,7 +6,7 @@ angular.module('cesium.modal.services', ['cesium.utils.services'])
 
 })
 
-.controller('AboutModalCtrl', function ($scope, UIUtils, csHttp) {
+.controller('AboutModalCtrl', function ($scope, csConfig, UIUtils, csHttp, filterTranslations) {
   'ngInject';
 
   $scope.openLink = function(event, uri, options) {
@@ -19,6 +19,9 @@ angular.module('cesium.modal.services', ['cesium.utils.services'])
 
     return csHttp.uri.open(uri, options);
   };
+
+  // Change UTC date into user date
+  $scope.buildDate = moment().utc(csConfig.build).format(filterTranslations.DATE_PATTERN || 'YYYY-MM-DD HH:mm');
 })
 
 .factory('ModalUtils', function($ionicModal, $rootScope, $q, $injector, $controller, $timeout, Device) {
diff --git a/www/templates/modal_about.html b/www/templates/modal_about.html
index 425d3c53..61496ac6 100644
--- a/www/templates/modal_about.html
+++ b/www/templates/modal_about.html
@@ -11,7 +11,7 @@
       <ion-item class="item-icon-left item-text-wrap">
         <span>{{'COMMON.APP_NAME'|translate}}&nbsp;<b>{{'COMMON.APP_VERSION'|translate:$root.config}}</b> - <a ng-click="openLink($event, 'http://cesium.app')">www.cesium.app</a></span>
         <i ng-if="$root.newRelease" class="assertive ion-alert-circled"></i>
-        <h3 ng-if="$root.config.build" class="gray">{{'COMMON.APP_BUILD'|translate:$root.config}}</h3>
+        <h3 ng-if="buildDate" class="gray">{{'COMMON.APP_BUILD'|translate:{build: buildDate} }}</h3>
         <span translate>ABOUT.LICENSE</span>
       </ion-item>
 
-- 
GitLab