getMonthName()
Returns the name of the month, for the given month number, in a given locale. The default locale is English.
info
Usage
import { getMonthName } from 'easy-dates';
getMonthName(local, index, short);
Prop types
prop | type | required | default |
---|---|---|---|
locale | String | no | en |
index | Number | no | current month |
short | Boolean | no | false |
Examples
getMonthName("en", 0); // "January"
getMonthName("en", 1); // "February"
getMonthName("fr", 0); // "Janvier"
getMonthName("fr", 1); // "Février"
with short parameter true
getMonthName("en", 0, true); // "Jan"
getMonthName("en", 1, true); // "Feb"
getMonthName("fr", 0, true); // "Jan"
getMonthName("fr", 1, true); // "Fév"
returns current month when no index is provided
getMonthName(); // "April"