Created
June 5, 2020 00:51
-
-
Save pignuante/b9c1574dbcf513e0f04958f72b3102bb to your computer and use it in GitHub Desktop.
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
function getWeekOfMonth(date) { | |
let adjustedDate = date.getDate()+date.getDay(); | |
let prefixes = ['0', '1', '2', '3', '4', '5']; | |
return (parseInt(prefixes[0 | adjustedDate / 7])+1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment