top | item 39763649

(no title)

blipmusic | 1 year ago

Wouldn't a "month" risk being many days off the intended target date, since it's a non-fixed timespan? E.g. how many days is "1 month from today" (March 20)? You mention medicine, so I assume there's something obvious I'm missing (then again, perhaps the constantly shifting dates for health care appointments where I live say otherwise ;D).

discuss

order

speg|1 year ago

You just increment the month. March 20 m+1 is April 20.

If the date is invalid, like January 30 m+1 then you fallback to next valid date, February 28/29.

blipmusic|1 year ago

Well, that’s not “the month” at all, though. At least not something I’d use outside of getting a rough idea for setting the next meeting, and absolutely wouldn’t use in code (but it’s probably fine for a todo - I’m complicating things, sorry ;-))

Edit: but perhaps that’s the custom used at many places and I’m just not aware.