From 76ff2328fdb1ec5ef1ff19056fb5a610bdda70d8 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 11 Jul 2018 16:51:59 -0400 Subject: [PATCH] LP#1766716: Adjust date display logic We were using the wrong date formating filter, egDueDate, and additionly the egOrgDateInContext filter was defaulting to the useless 'shortDate' format in cases where a format was not passed (such as when $root.egDateAndTimeFormat can't be found). Both of these are addressed here. Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- Open-ILS/src/templates/staff/admin/local/actor/closed_dates.tt2 | 4 ++-- Open-ILS/web/js/ui/default/staff/admin/local/actor/closed_dates.js | 1 + Open-ILS/web/js/ui/default/staff/services/ui.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/staff/admin/local/actor/closed_dates.tt2 b/Open-ILS/src/templates/staff/admin/local/actor/closed_dates.tt2 index 1c30d4eaa9..0bb9bec3e7 100644 --- a/Open-ILS/src/templates/staff/admin/local/actor/closed_dates.tt2 +++ b/Open-ILS/src/templates/staff/admin/local/actor/closed_dates.tt2 @@ -61,10 +61,10 @@ - {{item.close_start | egDueDate:$root.egDateAndTimeFormat:item.org_unit:item._duration}} + {{item.close_start | egOrgDateInContext:item._format:item.org_unit:item._duration}} - {{item.close_end | egDueDate:$root.egDateAndTimeFormat:item.org_unit:item._duration}} + {{item.close_end | egOrgDateInContext:item._format:item.org_unit:item._duration}} diff --git a/Open-ILS/web/js/ui/default/staff/admin/local/actor/closed_dates.js b/Open-ILS/web/js/ui/default/staff/admin/local/actor/closed_dates.js index 78da7fd444..992cde47e2 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/local/actor/closed_dates.js +++ b/Open-ILS/web/js/ui/default/staff/admin/local/actor/closed_dates.js @@ -70,6 +70,7 @@ function($scope , $q , $timeout , $location , $window , $uibModal , ngToast , var e = new Date(i.close_end); i._duration = ((e - s) / 1000) + 1; i._duration = '' + i._duration + ' seconds'; + i._format = $scope.$root.egDateAndTimeFormat; if (i.emergency_closing) { var x = i.emergency_closing.status.circulations - i.emergency_closing.status.circulations_complete; diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js index 0368923fb7..6916319993 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -248,7 +248,7 @@ function($timeout , $parse) { function eg_context_date_filter (date, format, orgID, interval) { var fmt = format; - if (!fmt) fmt = 'shortDate'; + if (!fmt) fmt = 'short'; // if this is a simple, one-word format, and it doesn't say "Date" in it... if (['short','medium','long','full'].filter(function(x){return fmt == x}).length > 0 && interval) { -- 2.11.0