Simplify twenty-four-hour time logic to be more generic.

(imported from commit bda4972b32b17a36518eddef701748f3a548e376)
This commit is contained in:
Tim Abbott
2015-09-19 23:17:36 -07:00
parent 9590d988c5
commit a59e41b5ee
3 changed files with 9 additions and 9 deletions

View File

@@ -363,17 +363,17 @@ exports.setup_page = function () {
});
$("#twenty_four_hour_time").change(function () {
var time_checkbox = $("#twenty_four_hour_time").is(":checked");
var data = {};
data.twenty_four_hour_time = JSON.stringify(time_checkbox);
var setting_value = $("#twenty_four_hour_time").is(":checked");
data.twenty_four_hour_time = JSON.stringify(setting_value);
channel.patch({
url: '/json/time_setting',
data: data,
success: function (resp, statusText, xhr, form) {
ui.report_success("Updated display settings! You will need to reload for the changes to take effect",
ui.report_success("Updated display settings! You will need to reload the window for your changes to take effect",
$('#display-settings-status').expectOne());
},
},
error: function (xhr, error_type, xhn) {
ui.report_error("Error updating display settings", xhr, $('#display-settings-status').expectOne());
}