Skip to content

Instantly share code, notes, and snippets.

@ajid2
Created Nov 30, 2021
Embed
What would you like to do?
Array(TOTAL_DATE).fill().forEach((_, i) => {
const date = new Date(new Date().getFullYear(), new Date().getMonth(), i + 1)
const day = date.getDate()
const month = date.toLocaleString('default', { month: 'long' })
const year = date.getFullYear()
const dateString = `${day} ${month} ${year}`
$('#date-box').append(`<div class="date-box-item">${dateString}</div>`)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment