2024-07-22 21:32:15 -06:00
|
|
|
script(type='text/javascript', src='https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=4.8.0&features=Intl')
|
2023-10-19 20:26:27 -06:00
|
|
|
script(type='text/javascript', src='https://cdn.jsdelivr.net/npm/luxon@3.4.3/build/global/luxon.min.js')
|
2020-11-29 20:05:42 -07:00
|
|
|
script.
|
2021-03-28 21:02:10 -06:00
|
|
|
function format_unixtime(unixtime, alt) {
|
|
|
|
|
if (alt == null)
|
|
|
|
|
alt = false;
|
|
|
|
|
// check if this date should be displayed in utc or local timezone
|
|
|
|
|
if (('#{settings.shared_pages.date_time.timezone}'.toLowerCase() == 'local' && !alt) || ('#{settings.shared_pages.date_time.timezone}'.toLowerCase() == 'utc' && alt))
|
|
|
|
|
return luxon.DateTime.fromSeconds(unixtime).toLocal().toFormat('#{settings.shared_pages.date_time.display_format}');
|
|
|
|
|
else
|
|
|
|
|
return luxon.DateTime.fromSeconds(unixtime).toUTC().toFormat('#{settings.shared_pages.date_time.display_format}');
|
|
|
|
|
}
|