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
const getFirstMondayDate = (daysInMonth, startMonthIndex, firstDayOfTheYearIndex) => { | |
const numberOfDaysUntillThisMonth = daysInMonth.reduce((acc, curr, i) => i < startMonthIndex ? acc + curr : acc) | |
let firstDayDate = 1 // first day of the year - only for 1st month | |
if (startMonthIndex > 0) { | |
// get date of firstDayOfTheYearIndex of given month (for example - first day of the year is Sunday, we will get date for Sunday for given month) | |
firstDayDate = 8 - (numberOfDaysUntillThisMonth - (startMonthIndex * 28)) |
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
### Keybase proof | |
I hereby claim: | |
* I am voslartomas on github. | |
* I am tvoslar (https://keybase.io/tvoslar) on keybase. | |
* I have a public key ASCjl0hDHWChA77Hty0qAL6_btcodAvV_7dv0bBAcSyImgo | |
To claim this, I am signing this object: |
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
s |