Last active
December 2, 2018 21:23
-
-
Save anthonybrown/519ce470f452ad29b2b566fc8ccc58d8 to your computer and use it in GitHub Desktop.
Using Array.from to compose dates
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.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleString('us-EN', { month: '2-digit' }))); |
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.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleString('us-EN', { month: 'long' }))); |
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.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleDateString('us-EN', {weekday: 'long'}))) |
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.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleString('us-EN', { month: 'narrow' }))); |
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.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleDateString('us-EN', {weekday: 'narrow'}))); |
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.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleString('us-EN', { month: 'short' }))); |
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.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleDateString('us-EN', {weekday: 'short'}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment