2019-05-09 18:54:39 +12:00
|
|
|
(function (window) {
|
|
|
|
"use strict";
|
|
|
|
|
2019-05-09 20:01:51 +12:00
|
|
|
window.ls.container.set('date', function () {
|
2022-08-10 02:05:34 +12:00
|
|
|
function format(format, datetime) {
|
|
|
|
if (!datetime) {
|
|
|
|
return null;
|
2019-05-09 18:54:39 +12:00
|
|
|
}
|
|
|
|
|
2022-08-10 02:05:34 +12:00
|
|
|
return new Intl.DateTimeFormat('en-US', {
|
|
|
|
timeZone: 'UTC',
|
|
|
|
hourCycle: 'h24',
|
|
|
|
...format
|
|
|
|
}).format(new Date(datetime));
|
2019-05-09 18:54:39 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
format: format,
|
|
|
|
}
|
|
|
|
}(), true);
|
|
|
|
|
|
|
|
})(window);
|