From 79f1ab4f66209e8b1e160bafbf188a40582a09ff Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 13 May 2024 11:13:28 +0200 Subject: [PATCH] Store timezone in session --- templates/fediplan/schedule.html.twig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/templates/fediplan/schedule.html.twig b/templates/fediplan/schedule.html.twig index ab7b4e8..834c982 100644 --- a/templates/fediplan/schedule.html.twig +++ b/templates/fediplan/schedule.html.twig @@ -485,6 +485,7 @@ $('#compose_attach_poll').val(0); } }); + var $collectionHolder; // setup an "add a tag" link @@ -543,8 +544,17 @@ searchPosition: "bottom", search: false }); - var timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + var timezone; + + if(!!sessionStorage.getItem('timeZone')) { + timezone = sessionStorage.getItem('timeZone'); + } else { + timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + } $('#compose_timeZone').val(timezone); + $('#compose_timeZone').on('change', function () { + sessionStorage.setItem("timeZone", this.value); + }); $(document).on('click', '.delete_media', function () { var id = $(this).attr('data-id'); $('#media_container_' + id).remove();