2023-11-01 01:59:19 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Fake 'now' date time for testing
|
2024-03-10 19:29:04 +01:00
|
|
|
// const fakeNow = null;
|
2023-11-01 01:59:19 +01:00
|
|
|
|
2024-03-10 19:29:04 +01:00
|
|
|
const fakeNow = Date.parse("2023-11-04T13:10:00");
|
2023-11-01 01:59:19 +01: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
|
|
|
|
}
|