-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow form to be used for both editing and creating events (#815)
* allow form to be used for both editing and creating * add tests * fix paddingg on cards
- Loading branch information
1 parent
13817ab
commit 84b1c9c
Showing
5 changed files
with
150 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { EventRenderingUtils } from "./EventUtils" | ||
|
||
describe("dateTimeLocalPlaceHolder", () => { | ||
it("should return a formatted string in ISO 8601 format without milliseconds", () => { | ||
const date = new Date("2024-11-01T23:34:15.123Z") | ||
const result = EventRenderingUtils.dateTimeLocalPlaceHolder(date) | ||
expect(result).toBe("2024-11-01T23:34:15") | ||
}) | ||
|
||
it("should handle dates without milliseconds correctly", () => { | ||
const date = new Date("2024-11-01T23:34:15Z") | ||
const result = EventRenderingUtils.dateTimeLocalPlaceHolder(date) | ||
expect(result).toBe("2024-11-01T23:34:15") | ||
}) | ||
|
||
it("should handle different time zones correctly", () => { | ||
const date = new Date("2024-11-01T23:34:15.123+09:00") | ||
const result = EventRenderingUtils.dateTimeLocalPlaceHolder(date) | ||
expect(result).toBe("2024-11-01T14:34:15") | ||
}) | ||
|
||
it("should handle leap years correctly", () => { | ||
const date = new Date("2024-02-29T23:34:15.123Z") | ||
const result = EventRenderingUtils.dateTimeLocalPlaceHolder(date) | ||
expect(result).toBe("2024-02-29T23:34:15") | ||
}) | ||
|
||
it("should handle dates before 1970 correctly", () => { | ||
const date = new Date("1969-12-31T23:34:15.123Z") | ||
const result = EventRenderingUtils.dateTimeLocalPlaceHolder(date) | ||
expect(result).toBe("1969-12-31T23:34:15") | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters