Skip to content

Instantly share code, notes, and snippets.

@abdihaikal
Last active August 2, 2024 00:00
Show Gist options
  • Save abdihaikal/09ce1fca216ab21f3a02095073cfe3b3 to your computer and use it in GitHub Desktop.
Save abdihaikal/09ce1fca216ab21f3a02095073cfe3b3 to your computer and use it in GitHub Desktop.
Get days in a month using Javascript
const getDaysInMonth = (yearValue: number, monthValue: number): number => {
return new Date(yearValue, monthValue, 0).getDate()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment