aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/event_head.tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-11-25 15:05:21 +0100
committerMario Vavti <mario@mariovavti.com>2015-11-25 15:05:21 +0100
commitfe57e7059bc6ef1942a6b054a4da8edfb5a07578 (patch)
treef4a73b035a07e2ab87ba9d6b19f180b66106bf5b /view/tpl/event_head.tpl
parent0559db9cf81267c34ca014fef1aebe1cf31de2ab (diff)
downloadvolse-hubzilla-fe57e7059bc6ef1942a6b054a4da8edfb5a07578.tar.gz
volse-hubzilla-fe57e7059bc6ef1942a6b054a4da8edfb5a07578.tar.bz2
volse-hubzilla-fe57e7059bc6ef1942a6b054a4da8edfb5a07578.zip
events: make sure default finish date is one hour after start date and shift the finishdate if startdate is shifted
Diffstat (limited to 'view/tpl/event_head.tpl')
-rwxr-xr-xview/tpl/event_head.tpl15
1 files changed, 13 insertions, 2 deletions
diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl
index d193696b7..7c252f446 100755
--- a/view/tpl/event_head.tpl
+++ b/view/tpl/event_head.tpl
@@ -97,7 +97,7 @@
}
}
- })
+ });
// center on date
var args=location.href.replace(baseurl,"").split("/");
@@ -113,6 +113,18 @@
var view = $('#events-calendar').fullCalendar('getView');
$('#title').text(view.title);
+ // shift the finish time date on start time date change automagically
+ 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 = 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");
+ $('#id_finish_text').val(fval);
+ origsval = sval;
+ });
+
+ // ACL
$('#id_share').change(function() {
if ($('#id_share').is(':checked')) {
@@ -123,7 +135,6 @@
}
}).trigger('change');
-
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
var selstr;
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {