feat: use native date picker + align date formats (#251)

* use native date picker

* use YYYY-MM-DD for date formats
This commit is contained in:
Hayden 2023-01-28 13:32:39 -09:00 committed by GitHub
parent 6ed1f3695a
commit cbac17c059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 122 deletions

View file

@ -63,11 +63,11 @@ export function fmtDate(value: string | Date, fmt: DateTimeFormat = "human"): st
switch (fmt) {
case "relative":
return useTimeAgo(dt).value + useDateFormat(dt, " (MM-DD-YYYY)").value;
return useTimeAgo(dt).value + useDateFormat(dt, " (YYYY-MM-DD)").value;
case "long":
return useDateFormat(dt, "MM-DD-YYYY (dddd)").value;
return useDateFormat(dt, "YYYY-MM-DD (dddd)").value;
case "short":
return useDateFormat(dt, "MM-DD-YYYY").value;
return useDateFormat(dt, "YYYY-MM-DD").value;
case "human":
// January 1st, 2021
return `${months[dt.getMonth()]} ${dt.getDate()}${ordinalIndicator(dt.getDate())}, ${dt.getFullYear()}`;