[ic] check date in order.profiles

Dan Browning interchange-users@icdevgroup.org
Wed Aug 7 12:51:00 2002


At 11:38 AM 8/7/2002 +0200, you wrote:


> > 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.
> >
>
>This is good thank you, but it does not work ....
>
>I have on checkout.html the date filed in format MM.DD.YYYY  lets say called
>date_delivery I put an required=1 to this field. :
>
>               [error name=date_delivery std_label="Delivery" required=1]
>             <INPUT TYPE=text NAME=date_delivery VALUE="[value
>date_delivery]" size="60" maxlength="60">
>
>
>I put you code in order.profile as  a user-defined check routine right at
>the beginning of the file.

Actually, it needs to go in interchange.cfg. :-)

+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Dan Browning, Kavod Technologies <db@kavod.com>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disco is to music what Etch-A-Sketch is to art.