From 830d3878ae88c9eb52ef944cc8dd592c8db8a5c8 Mon Sep 17 00:00:00 2001 From: realpha <0xrealpha@proton.me> Date: Wed, 22 Nov 2023 22:42:59 +0100 Subject: [PATCH] refactor(datetime): replace enum with object (#3836) --- datetime/week_of_year.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/datetime/week_of_year.ts b/datetime/week_of_year.ts index 3700e47aef32..731b26abb344 100644 --- a/datetime/week_of_year.ts +++ b/datetime/week_of_year.ts @@ -5,15 +5,15 @@ import { DAY, WEEK } from "./constants.ts"; const DAYS_PER_WEEK = 7; -enum Day { - Sun, - Mon, - Tue, - Wed, - Thu, - Fri, - Sat, -} +const Day = { + Sun: 0, + Mon: 1, + Tue: 2, + Wed: 3, + Thu: 4, + Fri: 5, + Sat: 6, +} as const; /** * Returns the ISO week number of the provided date (1-53).