You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Prevent future date selection in jump to date (#10419)
You can still type in whatever date you want (native date input behavior) but the UI picker has future dates disabled. Fix https://github.com/vector-im/element-web/issues/20800
This commit is contained in:
@ -19,6 +19,7 @@ import {
|
||||
formatRelativeTime,
|
||||
formatDuration,
|
||||
formatFullDateNoDayISO,
|
||||
formatDateForInput,
|
||||
formatTimeLeft,
|
||||
formatPreciseDuration,
|
||||
formatLocalDateShort,
|
||||
@ -126,6 +127,15 @@ describe("formatFullDateNoDayISO", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("formatDateForInput", () => {
|
||||
it.each([["1993-11-01"], ["1066-10-14"], ["0571-04-22"], ["0062-02-05"]])(
|
||||
"should format %s",
|
||||
(dateString: string) => {
|
||||
expect(formatDateForInput(new Date(dateString))).toBe(dateString);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("formatTimeLeft", () => {
|
||||
it.each([
|
||||
[0, "0s left"],
|
||||
|
Reference in New Issue
Block a user