Languages
[Edit]
EN

JavaScript - English month names

4 points
Created by:
Dexter
660

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

Quick solution:

const MONTH_FULL_NAMES = [
    'January',
    'February',
    'March',
    'April',
    'May',
    'June',
    'July',
    'August',
    'September',
    'October',
    'November',
    'December'
];

 

Inline:

const MONTH_FULL_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

Abbreviations:

const MONTH_SHORT_NAMES = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

 

Details

In this section, you can see other ways to name months with number of days.

-----------------------------------------------------------------------------
|           [ month name ]           |                                      |
|------------------------------------|          [ number of days ]          |
|  [ full name ]  [ abbreviation ]   |                                      |
|------------------------------------|--------------------------------------|
|                                    |                                      |
|    January        Jan.             |    31 days                           |
|    February       Feb.             |    28 days (29 days in leap years)   |  https://dirask.com/posts/JavaScript-check-if-specific-year-is-leap-przo3p
|    March          Mar.             |    31 days                           |
|    April          Apr.             |    30 days                           |
|    May            May.             |    31 days                           |
|    June           Jun.             |    30 days                           |
|    July           Jul.             |    31 days                           |
|    August         Aug.             |    31 days                           |
|    September      Sep.             |    30 days                           |
|    October        Oct.             |    31 days                           |
|    November       Nov.             |    30 days                           |
|    December       Dec.             |    31 days                           |
|                                    |                                      |
-----------------------------------------------------------------------------

Abbreviations (with dots):

const MONTH_SHORT_NAMES = ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'];

 

See also

  1. JavaScript - English day names

  2. JavaScript - check if specific year is leap

Alternative titles

  1. JavaScript - English month 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