diff --git a/calendar/js/app.js b/calendar/js/app.js index 0d5ba62a55..18753b986e 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2454,7 +2454,7 @@ app.classes.calendar = AppJS.extend( var range = ''; var datefmt = egw.preference('dateformat'); - var timefmt = egw.preference('timeformat') == 12 ? 'h:i a' : 'H:i'; + var timefmt = egw.preference('timeformat') === '12' ? 'h:i a' : 'H:i'; var month_before_day = datefmt[0].toLowerCase() == 'm' || datefmt[2].toLowerCase() == 'm' && datefmt[4] == 'd'; diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index 31cf60ccb6..f440400153 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -433,7 +433,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], if (event['end_m'] > 24*60) { timespan = jQuery.datepicker.formatTime( - egw.preference("timeformat") === 12 ? "h:mmtt" : "HH:mm", + egw.preference("timeformat") === "12" ? "h:mmtt" : "HH:mm", { hour: event.start_m / 60, minute: event.start_m % 60, @@ -442,7 +442,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], }, {"ampm": (egw.preference("timeformat") === "12")} ).trim()+' - '+jQuery.datepicker.formatTime( - egw.preference("timeformat") === 12 ? "h:mmtt" : "HH:mm", + egw.preference("timeformat") === "12" ? "h:mmtt" : "HH:mm", { hour: event.end_m / 60, minute: event.end_m % 60, @@ -464,7 +464,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], duration = Math.floor(duration/60) + this.egw().lang('h')+(duration%60 ? duration%60 : ''); timespan = jQuery.datepicker.formatTime( - egw.preference("timeformat") === 12 ? "h:mmtt" : "HH:mm", + egw.preference("timeformat") === "12" ? "h:mmtt" : "HH:mm", { hour: event.start_m / 60, minute: event.start_m % 60, diff --git a/calendar/js/et2_widget_planner.js b/calendar/js/et2_widget_planner.js index 17c9ca9a0b..391560a65d 100644 --- a/calendar/js/et2_widget_planner.js +++ b/calendar/js/et2_widget_planner.js @@ -1414,14 +1414,14 @@ var et2_calendar_planner = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResize var time = this._get_time_from_position(position.left, position.top); element.dropEnd = time; var formatted_time = jQuery.datepicker.formatTime( - egw.preference("timeformat") == 12 ? "h:mmtt" : "HH:mm", + egw.preference("timeformat") === "12" ? "h:mmtt" : "HH:mm", { hour: time.getUTCHours(), minute: time.getUTCMinutes(), seconds: 0, timezone: 0 }, - {"ampm": (egw.preference("timeformat") == "12")} + {"ampm": (egw.preference("timeformat") === "12")} ); element.innerHTML = '