Skip to content

Instantly share code, notes, and snippets.

@crshmk
Created November 29, 2022 07:13
Show Gist options
  • Save crshmk/8fd8777fd57f68e5de3d340062172e56 to your computer and use it in GitHub Desktop.
Save crshmk/8fd8777fd57f68e5de3d340062172e56 to your computer and use it in GitHub Desktop.
const monthLabels = Array(12)
.fill()
.map((_, i) => new Date(`${i+1}`).toDateString())
.map(date => date.slice(4, 7))
export default monthLabels
// ['Jan', 'Feb', 'Mar', ...'Dec']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment