aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/event_head.tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-11-25 19:02:48 +0100
committerMario Vavti <mario@mariovavti.com>2015-11-25 19:02:48 +0100
commita80c45940e14d75ef91b39e62d8aab9e2efc01cc (patch)
tree5fb588764eb1d2f6998e5eaf54c9c913d7d31e96 /view/tpl/event_head.tpl
parentab71e33d832c9207a7244436e5f40c51c7164a44 (diff)
downloadvolse-hubzilla-a80c45940e14d75ef91b39e62d8aab9e2efc01cc.tar.gz
volse-hubzilla-a80c45940e14d75ef91b39e62d8aab9e2efc01cc.tar.bz2
volse-hubzilla-a80c45940e14d75ef91b39e62d8aab9e2efc01cc.zip
add a if clause for the case we do not have a finish date
Diffstat (limited to 'view/tpl/event_head.tpl')
-rwxr-xr-xview/tpl/event_head.tpl13
1 files changed, 7 insertions, 6 deletions
diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl
index a7a455d50..ec43d7ab7 100755
--- a/view/tpl/event_head.tpl
+++ b/view/tpl/event_head.tpl
@@ -117,12 +117,13 @@
var origsval = $('#id_start_text').val();
$('#id_start_text').change(function() {
var origfval = $('#id_finish_text').val();
- var sval = $('#id_start_text').val();
- 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;
+ if(origfval) {
+ var sval = $('#id_start_text').val();
+ 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;
+ }
});
// ACL