mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-08-04 03:27:05 -04:00
21 lines
519 B
TypeScript
21 lines
519 B
TypeScript
import { newDate } from '../src/helpers.ts';
|
|
|
|
const overloadPeriods: Record<string, number[][]> = {
|
|
// en: [[15, 24]],
|
|
// pl: [[0, 24]],
|
|
};
|
|
|
|
export default (locale: string, timestamp: Date = newDate()) => {
|
|
if (overloadPeriods[locale] === undefined) {
|
|
return false;
|
|
}
|
|
|
|
for (const [periodStart, periodEnd] of overloadPeriods[locale]) {
|
|
if (timestamp.getUTCHours() >= periodStart && timestamp.getUTCHours() < periodEnd) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
};
|