Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Representing repetitive dates

Tags:

date

Repetitive Dates:

Billing cycles come in a lot of different formats, for example: "the first of the month", "third Friday of the month", or "first weekday on or after 21st day after the 13th of the month" (thanks visa!). My goal is to be able to represent these different billing cycles in one easily parsed database text field.

like image 885
alumb Avatar asked Dec 10 '08 21:12

alumb


1 Answers

You forgot weekend processing. If my bill is due on a Sunday, I want it to show up on Friday. That kind of thing. I think there are three possibilities:

  1. Always before the weekend
  2. Always after the weekend
  3. If it's Saturday, Friday, and if it's Sunday, Monday
like image 117
Jim Barrows Avatar answered Nov 12 '22 01:11

Jim Barrows