From 01bb00a8ec32c35520c1ac44e2ce0615f42374f6 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Oct 2018 16:04:14 +0200 Subject: [PATCH] better date formatting --- .../src/views/content/overlays/schedule.controller.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/overlays/schedule.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/overlays/schedule.controller.js index 1aad7cf07b..7974103b7a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/overlays/schedule.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/overlays/schedule.controller.js @@ -99,11 +99,13 @@ } function datePickerShow() { + // prevent the overlay from closing when the date picker is open $scope.model.disableBackdropClick = true; } function datePickerClose() { $timeout(function(){ + // allow the date picker to close now the date picker is closed $scope.model.disableBackdropClick = false; }); } @@ -159,15 +161,12 @@ } function formatDatesToLocal(variant) { - if(variant && variant.releaseDate) { - variant.releaseDateFormatted = dateHelper.getLocalDate(variant.releaseDate, vm.currentUser.locale, "YYYY-MM-DD HH:mm"); + variant.releaseDateFormatted = dateHelper.getLocalDate(variant.releaseDate, vm.currentUser.locale, "MMM Do YYYY, HH:mm"); } - if(variant && variant.removeDate) { - variant.removeDateFormatted = dateHelper.getLocalDate(variant.removeDate, vm.currentUser.locale, "YYYY-MM-DD HH:mm"); + variant.removeDateFormatted = dateHelper.getLocalDate(variant.removeDate, vm.currentUser.locale, "MMM Do YYYY, HH:mm"); } - } function changeSelection(variant) {