diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-11-25 17:28:26 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-11-25 17:28:26 +0100 |
commit | ab71e33d832c9207a7244436e5f40c51c7164a44 (patch) | |
tree | 55bd533585a828f95e543b1f367dbdf902062d60 | |
parent | fe57e7059bc6ef1942a6b054a4da8edfb5a07578 (diff) | |
download | volse-hubzilla-ab71e33d832c9207a7244436e5f40c51c7164a44.tar.gz volse-hubzilla-ab71e33d832c9207a7244436e5f40c51c7164a44.tar.bz2 volse-hubzilla-ab71e33d832c9207a7244436e5f40c51c7164a44.zip |
note to self: do not make things more complicated than they need to be.
-rwxr-xr-x | view/tpl/event_head.tpl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl index 7c252f446..a7a455d50 100755 --- a/view/tpl/event_head.tpl +++ b/view/tpl/event_head.tpl @@ -118,8 +118,9 @@ $('#id_start_text').change(function() { var origfval = $('#id_finish_text').val(); var sval = $('#id_start_text').val(); - var diff = origsval > sval ? moment(origsval).diff(sval) : moment(sval).diff(origsval); - var fval = origsval > sval ? moment(origfval).subtract(diff, 'millisecond').format("YYYY-MM-DD HH:mm") : moment(origfval).add(diff, 'millisecond').format("YYYY-MM-DD HH:mm"); + var diff = moment(sval).diff(origsval); + var fval = moment(origfval).add(diff, 'millisecond').format("YYYY-MM-DD HH:mm"); + $('#id_finish_text').val(fval); origsval = sval; }); |