Re:Ask HN: Why isn't there a `setDay` method on the Date pro...
by nicomfe on Monday September 19, 2016 @01:08AM
(#12529087)
cause if you have the date 19/09/2016 whats the point of setting the day of the week? so do you wanna set the date to be Thursday but still keep the 19/09/2016 that wouldnt make any sense, cause 19/09/2016 is Monday, and in all cases must be Monday.
[ Parent
| on HN ]
Re:Ask HN: Why isn't there a `setDay` method on the Date pro...
by saghm on Monday September 19, 2016 @08:33PM
(#12535990)
What if I wanted to get the day at the beginning of the week that a date occurred in? For instance, if you had a payroll system where you paid hourly workers weekly, it would be useful to be able to bucket the hours worked on the day that the paycheck is sent