From 0cf99d95380171c7d08baf050e169c109968240e Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 17 Jan 2022 21:32:44 +0100 Subject: [PATCH] Parse the working plan start and end value correctly, depending on the current time format setting. --- assets/js/utils/working_plan.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/utils/working_plan.js b/assets/js/utils/working_plan.js index 6651a707..ee554bdb 100755 --- a/assets/js/utils/working_plan.js +++ b/assets/js/utils/working_plan.js @@ -629,13 +629,15 @@ App.Utils.WorkingPlan = (function () { get() { const workingPlan = {}; + const timeFormat = App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm'; + $('.working-plan input:checkbox').each( function (index, checkbox) { const id = $(checkbox).attr('id'); if ($(checkbox).prop('checked') === true) { workingPlan[id] = { - start: moment($('#' + id + '-start').val(), 'HH:mm').format('HH:mm'), - end: moment($('#' + id + '-end').val(), 'HH:mm').format('HH:mm'), + start: moment($('#' + id + '-start').val(), timeFormat).format('HH:mm'), + end: moment($('#' + id + '-end').val(), timeFormat).format('HH:mm'), breaks: [] };