Skip to content

Instantly share code, notes, and snippets.

@yusufneeson
Created April 23, 2022 07:21
Show Gist options
  • Select an option

  • Save yusufneeson/23909737e5c3a0f0bd0ac15e1719031b to your computer and use it in GitHub Desktop.

Select an option

Save yusufneeson/23909737e5c3a0f0bd0ac15e1719031b to your computer and use it in GitHub Desktop.
Loop Day In Month Through Div Box
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