-
-
Save mselmany/dcfd64c9de9d87e4fc3df24e171444d3 to your computer and use it in GitHub Desktop.
auto-generates month names in any locale
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var months = []; | |
| for( var i = 0; i < 12; i++ ){ | |
| months.push( new Date(0,i).toLocaleString({},{month:'short'}) ); | |
| // you can also pass a local like : "en-US" instead of an empty object `{}`. | |
| // an empty object triggers the system's auto-detection | |
| } | |
| console.log(months); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment