import { dayNumber } from './index' describe('formatting - dayOfWeek', () => { const daylightSavingDateTime = '2021-02-28T00:00:00.000Z' // UTC, Sunday const standardDateTime = '2021-07-31T00:00:00.000Z' // UTC, Saturday it.each([ ['America/Phoenix', 'en-US', '27'], ['America/Chicago', 'en-US', '27'], ['America/New_York', 'en-US', '27'], ['America/Montevideo', 'es-UY', '27'], ['America/Sao_Paulo', 'pt-BR', '27'], ['UTC', 'en-US', '28'], ['UTC', 'en-GB', '28'], ['Europe/London', 'en-GB', '28'], ['Europe/Paris', 'fr-FR', '28'], ['Asia/Tbilisi', 'ka-GE', '28'], ['Asia/Kolkata', 'hi-IN', '28'], ])( 'daylightSavingDateTime - returns correct day number (TZ: %s, Locale: %s)', (timezone, locale, localisedResult) => expect(dayNumber(daylightSavingDateTime, { timezone, locale })).toEqual( localisedResult ) ) it.each([ ['America/Phoenix', 'en-US', '30'], ['America/Chicago', 'en-US', '30'], ['America/New_York', 'en-US', '30'], ['America/Montevideo', 'es-UY', '30'], ['America/Sao_Paulo', 'pt-BR', '30'], ['UTC', 'en-US', '31'], ['UTC', 'en-GB', '31'], ['Europe/London', 'en-GB', '31'], ['Europe/Paris', 'fr-FR', '31'], ['Asia/Tbilisi', 'ka-GE', '31'], ['Asia/Kolkata', 'hi-IN', '31'], ])( 'standardDateTime - returns correct day number (TZ: %s, Locale: %s)', (timezone, locale, localisedResult) => expect(dayNumber(standardDateTime, { timezone, locale })).toEqual( localisedResult ) ) })