-
Notifications
You must be signed in to change notification settings - Fork 316
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
Native Date format using toLocaleDateString #60
Comments
PR welcome |
Well, for the examples in the table, I think all you need is: var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' };
date.toLocaleDateString('en-US', options); and var options = { weekday: 'short', hour: 'numeric'};
date.toLocaleDateString('en-US', options); You can also put |
I can make the simple PR, but tests fail because there's a comma difference: Native also doesn't support |
@Amorymeltzer feel free to fix the test too. |
How about Intl.DateTimeFormat? Performance note as mentioned in the toLocaleDateString mdn page. |
Hi, I really like this! thanks for your effort!
I Know it's not exactly the same, but i think you can add toLocaleDateString as an native option for date formatting. More in the link below:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString
The text was updated successfully, but these errors were encountered: