3 ms·
I must be missing something. That is how modulo works. Well as long as January is month 0.
by Aloisius 4y ago
I must be missing something. That is how modulo works. Well as long as January is month 0.
- SoftAnnaLee 4y agoIt seems that the issue is that `January === 1`; so when you get to December (i.e. `12`) it rolls over to 0 rather than remaining as 12.
- thaumasiotes 4y agoYou want (current_month % 12) + 1.