This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2021-07-10 07:46:29 -07:00
|
|
|
const overloadPeriods = {
|
2021-07-10 10:02:08 -07:00
|
|
|
en: [[16, 23]],
|
2021-07-10 07:46:29 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = (locale, timestamp = new Date) => {
|
|
|
|
if (overloadPeriods[locale] === undefined) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (let [periodStart, periodEnd] of overloadPeriods[locale]) {
|
|
|
|
if (timestamp.getUTCHours() >= periodStart && timestamp.getUTCHours() < periodEnd) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|