So hold up. You can create a date that references December 31 by creating it as January 365 in Javascript? What about January -1, does that one work too?
But you don't need an array for the day of the month. 8-)
If they started with zero for months but not for day of the week, that would be weird.
And obviously the whole thing is less than ideal but you take what you can get. Ideally, everything should be wrapped in a better object class and you should have a calendar table so you don't have to figure out month names, last day of the month, etc., on the fly.
107
u/Mara_li 28d ago
Well, Temporal is here now.
56
u/Anonymislim 28d ago
Two bugs for the price of one: the wrong month, and a month that doesn’t exist.
155
u/the_horse_gamer 28d ago
always remember that javascript's date library was copied from Java's (old one) so it's all their fault
30
u/SuitableDragonfly 28d ago
So hold up. You can create a date that references December 31 by creating it as January 365 in Javascript? What about January -1, does that one work too?
13
u/StrengthTheory 28d ago
You deserve it if you handle something sensitive like subscriptions with raw Dates and not a library.
5
u/OutlandishnessOver62 28d ago
February 30..? Lol
37
u/[deleted] 28d ago
[removed] — view removed comment