Skip to content

Commit

Permalink
refactor(datetime): replace enum with object (#3836)
Browse files Browse the repository at this point in the history
  • Loading branch information
realpha authored Nov 22, 2023
1 parent 7f5229e commit 830d387
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions datetime/week_of_year.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 830d387

Please sign in to comment.