Languages
[Edit]
EN

JavaScript - English day names

10 points
Created by:
Anisha-Kidd
652

This article was created to speed up software developer programming by providing JavaScript arrays with day names.

Quick solution:

const DAY_FULL_NAMES = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];

Note: days in the above are ordered according to Date class provided by JavaScript: Sunday first, Saturday last.

 

Abbreviations:

const DAY_SHORT_NAMES_1 = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
const DAY_SHORT_NAMES_2 = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];

 

Details

In this section, you can see other ways to name days of the week.

--------------------------------------------------------------------------------
|                                         |            [ day name ]            |
|-------------------------------------------------------------------------------
|                      |                  |  [ full name ]  [ abbreviations ]  |
|-------------------------------------------------------------------------------
|                      |                  |                                    |
|                      |                  |    Monday         Mon.   Mo.       |
|                      |   [ weekdays ]   |    Tuesday        Tue.   Tu.       |
|                      |                  |    Wednesday      Wed.   We.       |
|  [days of the week]  |    ( 5 days )    |    Thursday       Thu.   Th.       |
|                      |                  |    Friday         Fri.   Fr.       |
|                      |                  |                                    |
|       (7 days)       ---------------------------------------------------------
|                      |                  |                                    |
|                      |   [ weekend  ]   |    Saturday       Sat.   Sa.       |
|                      |    ( 2 days )    |    Sunday         Sun.   Su.       |
|                      |                  |                                    |
--------------------------------------------------------------------------------

Abbreviations (with dots):

const DAY_SHORT_NAMES_1 = ['Su.', 'Mo.', 'Tu.', 'We.', 'Th.', 'Fr.', 'Sa.'];
const DAY_SHORT_NAMES_2 = ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'];

Other:

const WEEKDAY_DAY_NAMES = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'];
const WEEKEND_DAY_NAMES = ['Saturday', 'Sunday'];

 

See also

  1. JavaScript - English month names

Alternative titles

  1. JavaScript - English day names array
  2. JavaScript - English week day names array
  3. JavaScript - English weekday names array
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join