mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 04:34:15 -04:00
19 lines
432 B
JavaScript
19 lines
432 B
JavaScript
const overloadPeriods = {
|
|
// en: [[15, 24]],
|
|
// pl: [[0, 24]],
|
|
};
|
|
|
|
export default (locale, timestamp = new Date()) => {
|
|
if (overloadPeriods[locale] === undefined) {
|
|
return false;
|
|
}
|
|
|
|
for (const [periodStart, periodEnd] of overloadPeriods[locale]) {
|
|
if (timestamp.getUTCHours() >= periodStart && timestamp.getUTCHours() < periodEnd) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
};
|