We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca0374b commit 1907f13Copy full SHA for 1907f13
site/src/components/Timeline/Timeline.test.tsx
@@ -2,7 +2,13 @@ import { createDisplayDate } from "./TimelineDateRow"
2
3
describe("createDisplayDate", () => {
4
it("returns correctly for Saturdays", () => {
5
- const date = new Date("Sat Dec 03 2022 00:00:00 GMT-0500")
+ const now = new Date()
6
+ const date = new Date(
7
+ now.getFullYear(),
8
+ now.getMonth(),
9
+ // Previous Saturday, from now.
10
+ now.getDate() - now.getDay() - 1,
11
+ )
12
expect(createDisplayDate(date)).toEqual("last Saturday")
13
})
14
0 commit comments