From 5cf4a47b48cf7148fbab2819d8464e490709b703 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Thu, 9 Jan 2020 12:14:33 +0100 Subject: [PATCH] web interface: fix setting expiration date editor autoformatting changed the meaning of the code --- templates/user.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/templates/user.html b/templates/user.html index 560c58e1..b9ddfc65 100644 --- a/templates/user.html +++ b/templates/user.html @@ -211,27 +211,27 @@ } }); - { { if gt.User.ExpirationDate 0 } } + {{ if gt .User.ExpirationDate 0 }} var input_dt = moment({{.User.ExpirationDate }}).format('YYYY-MM-DD'); - $('#idExpirationDate').val(input_dt); - $('#expirationDatePicker').datetimepicker('viewDate', input_dt); - { { end } } + $('#idExpirationDate').val(input_dt); + $('#expirationDatePicker').datetimepicker('viewDate', input_dt); + {{ end }} - $("#user_form").submit(function (event) { - var dt = $('#idExpirationDate').val(); - if (dt) { - var d = $('#expirationDatePicker').datetimepicker('viewDate'); - if (d) { - var dateString = moment(d).format('YYYY-MM-DD HH:mm:ss'); - $('#hidden_start_datetime').val(dateString); + $("#user_form").submit(function (event) { + var dt = $('#idExpirationDate').val(); + if (dt) { + var d = $('#expirationDatePicker').datetimepicker('viewDate'); + if (d) { + var dateString = moment(d).format('YYYY-MM-DD HH:mm:ss'); + $('#hidden_start_datetime').val(dateString); + } else { + $('#hidden_start_datetime').val(""); + } } else { $('#hidden_start_datetime').val(""); } - } else { - $('#hidden_start_datetime').val(""); - } - return true; - }); + return true; + }); }); {{end}} \ No newline at end of file