fix(date): preserve zero-padding when using MDY and YMD date formats

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
David Ralph
2026-04-08 22:39:54 +01:00
parent 1ef65fb5d2
commit 69d91cc6f1

View File

@@ -64,13 +64,15 @@ const DateWidget = () => {
let year = dateYear;
switch (localStorage.getItem('dateFormat')) {
case 'MDY':
day = dateMonth;
month = dateDay;
case 'MDY': {
const temp = day;
day = month;
month = temp;
break;
}
case 'YMD':
day = dateYear;
year = dateDay;
year = zero ? ('00' + dateDay).slice(-2) : dateDay;
break;
default:
break;