Last active
July 24, 2019 17:19
-
-
Save letanure/86731fa5ba64b07f4aa59b92a84b8975 to your computer and use it in GitHub Desktop.
create array months in any language π
This file contains 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
[...Array(12)].map((item, index) => ( new Date(Date.UTC(0, ++index, 0, 0, 0, 0)).toLocaleDateString('de-DE', { month: 'long' }) )) | |
Object.assign(...[...Array(12)].map((item, index) => new Date(Date.UTC(0, ++index, 0, 0, 0, 0)).toLocaleDateString('pt-BR', { month: 'long' })).map((month, index) => ({[index]: month}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment