From 721df5833dba1054ba902ced780c48534286f284 Mon Sep 17 00:00:00 2001 From: Andrea Date: Thu, 12 Apr 2018 16:15:18 +0200 Subject: [PATCH] Update for new time format --- src/assets/js/working_plan.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/assets/js/working_plan.js b/src/assets/js/working_plan.js index 57f6692c..e9cce228 100755 --- a/src/assets/js/working_plan.js +++ b/src/assets/js/working_plan.js @@ -48,7 +48,7 @@ $.each(workingPlan, function (index, workingDay) { if (workingDay != null) { $('#' + index).prop('checked', true); - $('#' + index + '-start').val(Date.parse(workingDay.start).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase()); + $('#' + index + '-start').val(Date.parse(workingDay.start).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase()); $('#' + index + '-end').val(Date.parse(workingDay.end).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase()); // Add the day's breaks on the breaks table. @@ -99,16 +99,16 @@ if (extraWorkingDay != null) { $('#' + index).prop('checked', true); - $('#' + index + '-start').val(Date.parse(extraWorkingDay.start).toString(GlobalVariables.timeFormat).toUpperCase()); - $('#' + index + '-end').val(Date.parse(extraWorkingDay.end).toString(GlobalVariables.timeFormat).toUpperCase()); + $('#' + index + '-start').val(Date.parse(extraWorkingDay.start).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase()); + $('#' + index + '-end').val(Date.parse(extraWorkingDay.end).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase()); var day = GeneralFunctions.formatDate(Date.parse(index), GlobalVariables.dateFormat, false); var tr = '' + '' + day + '' + - '' + Date.parse(extraWorkingDay.start).toString(GlobalVariables.timeFormat).toUpperCase() + '' + - '' + Date.parse(extraWorkingDay.end).toString(GlobalVariables.timeFormat).toUpperCase() + '' + + '' + Date.parse(extraWorkingDay.start).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase()).toUpperCase() + '' + + '' + Date.parse(extraWorkingDay.end).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase()).toUpperCase() + '' + '' + '