-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
date format #1
Comments
The code uses const originDate = new Date(originTimestamp);
return `${originDate.toLocaleDateString()} ${originDate.toLocaleTimeString()}`; Both these functions are based on the browser's default language / locale:
The date the extension shows in the tooltip uses a short date format for the browser's default locale. It's possible to change it to a long format, but that will be even more dependent on the current language / locale and I'm not sure it would be preferable. Here's an example of long date formatting, from MDN: const event = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
console.log(event.toLocaleDateString('de-DE', options));
// expected output (varies according to local timezone): Donnerstag, 20. Dezember 2012
console.log(event.toLocaleDateString('ar-EG', options));
// expected output (varies according to local timezone): الخميس، ٢٠ ديسمبر، ٢٠١٢ Anyway, it's a simple extension I wrote years ago. I'm not really interested or motivated to put the time and work to add configuration options to it (which would include a dedicated settings page, storage and synchronization code, requesting further permissions, etc.). I don't feel it would be worth the effort. |
Hi, could you consider other date/time formats? My system, and firefox for that matter, use the ISO YYYY-MM-DD format, but the Tooltip displays DD.MM.YYYY instead.
Many thanks for the extension 👍
The text was updated successfully, but these errors were encountered: