We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d96fc8c commit 5568a13Copy full SHA for 5568a13
src/components/experimental/DatePicker/util/index.ts
@@ -61,5 +61,10 @@ export function dateToCalendarDate(d: Date): CalendarDate {
61
}
62
63
export function calendarDateToDate(dv: DateValue): Date {
64
- return new Date(dv.year, dv.month - 1, dv.day);
+ const d = new Date(dv.year, dv.month - 1, dv.day);
65
+ // `new Date()` treats 2-digit years as 19xx, `setFullYear` corrects this.
66
+ if (dv.year < 100) {
67
+ d.setFullYear(dv.year);
68
+ }
69
+ return d;
70
0 commit comments