refactor(datetime): replace enum with object (#3836)

This commit is contained in:
realpha 2023-11-22 22:42:59 +01:00 committed by GitHub
parent 7f5229e4da
commit 830d3878ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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).