Support for missing format string in `useDateFormat()` from `dayjs`
See original GitHub issueClear and concise description of the problem
It’s nice to have some of the missing format string in useDateFormat()
as per dayjs
for common use case, such as:
MMM | Jan-Dec | The abbreviated month name
MMMM | January-December | The full month name
dd | Su-Sa | The min name of the day of the week
ddd | Sun-Sat | The short name of the day of the week
dddd | Sunday-Saturday | The name of the day of the week
A | AM PM |
a | am pm
Reference: https://day.js.org/docs/en/display/format
Also, with the missing format, we could potentially reduce overall bundle size by not bundling dayjs
for common formatting use case.
Suggested solution
Support the proposed missing format string.
Alternative
No response
Additional context
https://day.js.org/docs/en/display/format
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that request the same feature to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
String + Format
If you know the format of an input string, you can use that to parse a date. This dependent on CustomParseFormat plugin to...
Read more >How do I format a date in JavaScript? - Stack Overflow
formatString : A format string in the same format expected by the strftime() function in C. var today = new Date(); today.toLocaleFormat('%d-%b-%Y'); ...
Read more >The Complete Guide to Day.js - Mirza Leka - Medium
Custom Parse Format extends dayjs() the constructor to support custom formats of input strings. Basically, it allows us to pass the date ...
Read more >Working with Dates and Times with Day.js
Day.js Support in JavaScript Community. ... When we run Day.js in the browser, the .format() method returns a string in ISO format.
Read more >Template::Plugin::Date
Plugin to generate formatted date strings ... locale = 'en_GB' use_offset = 1) %] # specify default format to plugin [% USE date(format...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is some misunderstanding here, I don’t see how “Jan-Dec”, “Sun-Mon” or “am/pm” involve any locale here. It’s a purely formatting option as opposed to presenting it as numbers such as 1-12 (month), 0-6 (weekday), and 0-23 (hours in am/pm). it’s simply a mapping of objects/arrays.
If you mean translating the date format into another locale/language, I do agree that would certainly be out of scope for
VueUse
.This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.