Bug 31149: Add dayjs plugins

It seems dayjs is now being imported twice? With the second time overriding the first, but without the plugins.
This patch "fixes" the issue by proving this, but there is likely a better solution than this copy-paste from js-date-format.inc

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-10-16 09:29:22 +00:00 committed by Lucas Gass
parent b6aab57065
commit 1a6e53b7c1
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 6 additions and 0 deletions

View File

@ -38,12 +38,18 @@
</script>
<!-- / calendar.inc -->
[% Asset.js("lib/dayjs/dayjs.min.js") | $raw %]
[% Asset.js("lib/dayjs/plugin/utc.js") | $raw %]
[% Asset.js("lib/dayjs/plugin/timezone.js") | $raw %]
[% Asset.js("lib/dayjs/plugin/customParseFormat.js") | $raw %]
[% Asset.js("js/calendar.js") | $raw %]
[% Asset.js("lib/flatpickr/flatpickr.min.js") | $raw %]
[% Asset.js("lib/flatpickr/shortcut-buttons-flatpickr.min.js") | $raw %]
[% Asset.js("lib/maskito/maskito.core.js") | $raw %]
[% Asset.js("lib/maskito/maskito.kit.js") | $raw %]
<script>
dayjs.extend(window.dayjs_plugin_utc);
dayjs.extend(window.dayjs_plugin_timezone);
dayjs.extend(window.dayjs_plugin_customParseFormat);
flatpickr.l10ns.default.weekdays = flatpickr_weekdays;
flatpickr.l10ns.default.months = flatpickr_months;
flatpickr.l10ns.default.rangeSeparator = flatpickr_rangeSeparator;