1
0
Fork 0
mirror of synced 2024-09-03 03:11:39 +12:00
appwrite/public/scripts/services/date.js
2022-08-09 16:05:34 +02:00

22 lines
No EOL
491 B
JavaScript

(function (window) {
"use strict";
window.ls.container.set('date', function () {
function format(format, datetime) {
if (!datetime) {
return null;
}
return new Intl.DateTimeFormat('en-US', {
timeZone: 'UTC',
hourCycle: 'h24',
...format
}).format(new Date(datetime));
}
return {
format: format,
}
}(), true);
})(window);