[ic] check date in order.profiles

Dan Browning interchange-users@icdevgroup.org
Tue Aug 6 18:45:01 2002


At 12:05 AM 8/7/2002 +0200, you wrote:
>Hi
>
>this look quite hard , at least for me.
>
>What are the requirements:
>
>If someting is orderd, there is the posibility of putting in, a special
>delivery date, lets say I order something today and want it delivered in 3
>weeks on a birthday. This works so far.
>
>But I need to check that the date is not in the past, since it would not
>make any sense. I figured out I have to put some kind of date checking into
>order.profiles but I dont know what or how to do it.... I am sitting on this
>over a day now.
>
>Any help or pointer would be greatly apreciated.
>
>Thank you
>Andrei G

I don't know if it will be of any use, but since you asked I put my 
"date_past" check routine up:

http://www.icdevgroup.org/~danb

[Warning: serious formatting problems, may cause blindness in those 
sensitive to ugly code ]

As the name suggests, it makes sure it is a valid date (leap year, leap 
day, etc.), then it checks to make sure it is in the past (birthday) -- you 
would have to modify it to make it look for dates in the future.  It is 
also rather inclusive, i.e. 2-digit years allowed, 1-digit months/days, etc.

I've been meaning to clean it up a bit and commit it, later on.  Please, if 
you do make a future-based system off of it, let me know so I can commit 
that as well.  (Or if you even just fix the formatting, bleach, how did I 
let it get so bad?).  jEdit has a auto-cleanup for Java, C, and C++, but 
still waiting for perl.  :-)

+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Dan Browning, Kavod Technologies <db@kavod.com>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Air is water with holes in it