how about the “datecompare” function with the “dateAdd” function

 

 

datecompare:

http://livedocs.macromedia.com/coldfusion/6/CFML_Reference/functions-pt156.htm

 

dateadd:

http://livedocs.macromedia.com/coldfusion/6/CFML_Reference/functions-pt155.htm#1102869

 

 

 

just a thought

barry.b

 


From: Gareth Edwards
Sent: Thursday, 1 April 2004 1:43 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: datecompare problem

 

or even

 

variable=CreateDate(GetToken(form.date,3,'/'),GetToken(form.date,2,'/'),GetToken(form.date,1,'/'));

 

Gareth.

-----Original Message-----
From: Taco Fleur [mailto:[EMAIL PROTECTED]
Sent: Thursday, 1 April 2004 1:00 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: datecompare problem

Try something like createDate(listLast(form.date, "/"), listGetAt(form.date, 2, "/"), listLast(form.date, "/"))

 

Taco Fleur
07 3535 5072

Tell me and I will forget
Show me and I will remember
Teach me and I will learn

-----Original Message-----
From: Gavin Cooney [mailto:[EMAIL PROTECTED]
Sent: Thursday, 1 April 2004 12:49 PM
To: CFAussie Mailing List
Subject: [cfaussie] datecompare problem

Hi all,

 

I'm coming up with a small date problem and was wondering if someone could help.

 

I have a date in a form. This is vacating date on a property website. (the user can let the agency know when they are leaving a property). This date must me more than 3 weeks away or else the user gets a message before they can submit the form.

 

This is code i have:

 

<cfif (isdate(form.vacating_date) and DateCompare(lsdateformat(form.vacating_date), DateAdd("d", +21, now())) eq 1) OR isdefined("form.vacancy_date_okd")>

 

Form submits....

 <cfelse>

tell user that the date is in the next 21 days

 

They check a box called vacancy_date_okd and dont get the message again (or they change the date).

 

</cfif>

 

If i put in a date like 13/04/2004 and it tells the user that there is a problem


  #lsdateformat(form.vacating_date,"full")# =
Tuesday, 13 April 2004

  #dateformat(form.vacating_date,"full")# =
Tuesday, April 13, 2004

But if i put in a date like 08/04/2004 it submits the form without warning the user...

 

 #lsdateformat(form.vacating_date,"full")# = Thursday, 8 April 2004

  #dateformat(form.vacating_date,"full")# = Wednesday, August 4, 2004

 

Any ideas of how to do the datecompare?

 

Thanks

 

Gav

 

 

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to