diff options
author | Mario <mario@mariovavti.com> | 2023-07-03 18:35:10 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-07-03 18:35:10 +0000 |
commit | a3092204a1583b58cd9680f2902a6982bd8dd807 (patch) | |
tree | 2e5182767c31b672d77b7e2ed073f067a0bad634 /view/tpl | |
parent | 10b49af776e3a8cc94cb99332fca987503b09be1 (diff) | |
download | volse-hubzilla-a3092204a1583b58cd9680f2902a6982bd8dd807.tar.gz volse-hubzilla-a3092204a1583b58cd9680f2902a6982bd8dd807.tar.bz2 volse-hubzilla-a3092204a1583b58cd9680f2902a6982bd8dd807.zip |
fix issue #1771
Diffstat (limited to 'view/tpl')
-rw-r--r-- | view/tpl/cdav_calendar.tpl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/view/tpl/cdav_calendar.tpl b/view/tpl/cdav_calendar.tpl index 1bf54103c..88aa0789d 100644 --- a/view/tpl/cdav_calendar.tpl +++ b/view/tpl/cdav_calendar.tpl @@ -357,8 +357,16 @@ $(document).ready(function() { $('#calendar_select').val('channel_calendar').attr('disabled', true); $('#id_title').val(resource.summary); - $('#id_dtstart').val(new Date(resource.dtstart).toUTCString().slice(0, -4)); - $('#id_dtend').val(new Date(resource.dtend).toUTCString().slice(0, -4)); + + // A hack to match with internal workings of fullcalendar. + // See https://fullcalendar.io/docs/timeZone#UTC-coercion + let start_d = new Date(resource.dtstart); + let start_o = start_d.getTimezoneOffset(); + let end_d = new Date(resource.dtend); + let end_o = start_d.getTimezoneOffset(); + $('#id_dtstart').val(new Date(start_d - start_o * 60000).toUTCString().slice(0, -4)); + $('#id_dtend').val(new Date(end_d - end_o * 60000).toUTCString().slice(0, -4)); + $('#id_categories').tagsinput('add', '{{$categories}}'), $('#id_description').val(resource.description); $('#id_location').val(resource.location); |