Get single letter abbreviation of week day.
See original GitHub issueDescription of the Issue and Steps to Reproduce:
I need to get single letter abbreviation of week day e.g. R
for Thursday, F
for Friday, S
for Saturday, U
for Sunday.
Using moment().format('d')
give the number of the day of the week.
Is this supported by moment or can I added explicitly?
Environment:
Chrome 63 on OSX.
Moment version: 2.20.1.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
One Digit Day of Week Abbreviations - EventGuide
One Digit Day Codes ; W, Wednesday ; R, Thursday, Uses "R" to prevent confusion with Tuesday. ; F, Friday ; S, Saturday,...
Read more >Standard Month and Days of the Week Abbreviations
S or U - Sunday; M - Monday; T or Tu - Tuesday; W - Wednesday; Th or R - Thursday; F -...
Read more >Is there a single character day of the week convention?
I've usually seen 'H' for Thursday. · ha, I'm used to 'R' for thursday.
Read more >3, 2 and 1 letter abbreviations for days of the week
3, 2 and 1 letter abbreviations for days of the week · M · T · W · R · F · S...
Read more >One Letter Abbreviation for the Day of the Week
If you use single letters to represent the day of the week, you will run into problems with Sunday/Saturday and Tuesday/Thursday.
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 Free
Top 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
The shortest form you can get is 2-letters (in English):
moment().format('dd')
I’ve never seen Thursday abbreviated as ‘R’. Have you made that up?
If you’re not going to use the existing minimal weekday abbreviations used by
dd
, you can useupdateLocale
to overrideHowever… I would strongly advise against doing this. I can’t think of any scenario where a 1-character abbreviated weekday makes sense: it makes no sense on a calendar, as dates are 2-digits, and it makes no sense in isolation where ‘T’ and ‘S’ will be confusing abbreviations unless the full set of other characters is known. And, frankly, U and R are ridiculous stand-ins for Sunday and Thursday in any circumstance (both of which contain a ‘U’…)