Cool fix. It would be nicer though if you could explicitly check for `dow === 0`.

Also unfortunately you are leaking the `getDayOfWeek` function into the global scope since it is preceded by a semicolon.

Could you please fix these two issues? Thanks!