Closed farski closed 1 month ago
This update involves a simple yet significant change in how dates are formatted within the index.html
file. The previous method of using toISOString
has been replaced with toLocaleString('sv')
, enhancing the date presentation to better suit user preferences and regional formats.
File | Change Summary |
---|---|
views/index.html |
Switched date formatting from toISOString to toLocaleString('sv') |
🐇✨📅
A tiny hop in code, a giant leap for usability,
From ISO to Locale, oh what a tweak so fab!
Dates shine brighter, in format so sleek,
A rabbit's cheer for the code that now speaks!
🥕🎉🐾
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
merged, thank you
new Date().toISOString()
always returns the current time in UTC, so when it's after UTC midnight, but still before UTC midnight of the previous day (say, at 10 PM in New York), the date picker defaults to tomorrow, which will never contain any data.This changes to use
toLocaleString
to ensure the date picker always reflects the browser's local today date. It uses the Swedish (sv
) locale simply because they use anYYYY-MM-DD
date format, which is the most useful in this case