Playing around with local date time parsing.

This commit is contained in:
James Cole
2024-11-09 20:38:30 +01:00
parent 0d11769590
commit 0ae5593dde
5 changed files with 19 additions and 5 deletions

View File

@@ -26,6 +26,16 @@ $.ajaxSetup({
}
});
function parseToLocalDates() {
"use strict";
$('span.date-time').each(function () {
var date = $(this).data('date');
var obj = moment.utc(date).local();
var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
$(this).text(obj.format(date_time_js) + ' ('+ timeZone +')');
});
}
$(function () {
"use strict";
@@ -96,6 +106,9 @@ $(function () {
// trigger list thing
listLengthInitial();
// update dates:
parseToLocalDates();
});
function currencySelect(e) {