21 lines
426 B
JavaScript
21 lines
426 B
JavaScript
'use strict';
|
|
|
|
// Fake 'now' date time for testing
|
|
const fakeNow = null;
|
|
|
|
// const fakeNow = Date.parse("2023-11-04T07:30:00");
|
|
|
|
|
|
const fakeTimeDelta = fakeNow === null ? 0 : fakeNow - Date.now();
|
|
|
|
|
|
// Real 'now' date time for production
|
|
const nowJS = () => Date.now() + fakeTimeDelta;
|
|
|
|
// Real 'now' date time for production as luxon DateTime object
|
|
const now = () => luxon.DateTime.fromMillis(nowJS());
|
|
|
|
|
|
export {
|
|
now
|
|
}
|