Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 674 Bytes

File metadata and controls

27 lines (23 loc) · 674 Bytes

MonthsNames enumeration

Allows to refer to the month by name, not by number what usually confusing with numeration from 0.

enum MonthsNames {
  january = "JANUARY",
  february = "FEBRUARY",
  march = "MARCH",
  april = "APRIL",
  may = "MAY",
  june = "JUNE",
  july = "JULY",
  august = "AUGUST",
  september = "SEPTEMBER",
  october = "OCTOBER",
  november = "NOVEMBER",
  december = "DECEMBER"
}

If you need lower case or capitalize first character, use dedicated functionality:

console.log(MonthsNames.january.toLowerCase()); // "january"
console.log(capitalizeFirstCharacter(MonthsNames.january.toLowerCase())); // "January"