Skip to content

Commit

Permalink
Merge pull request #67 from WickyNilliams/bugfix/today
Browse files Browse the repository at this point in the history
fixes #56
  • Loading branch information
WickyNilliams authored Nov 1, 2024
2 parents 599194f + 60e336e commit 7c59576
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { PlainDate, type PlainYearMonth } from "./temporal.js";
export type DaysOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;

export function today() {
return PlainDate.from(new Date());
const d = new Date();
return new PlainDate(d.getFullYear(), d.getMonth() + 1, d.getDate());
}

export function startOfWeek(
Expand Down

0 comments on commit 7c59576

Please sign in to comment.