This topic is locked

Block out calendar dates

5/26/2010 5:25:15 PM
ASPRunnerPro General questions
M
mfred author

I built an ordering system and the client wants no due dates prior to 14 days from the order. I figured out how to edit the calendar so that the default highlighted date is 14 days forward. But is there a way to prevent selection of dates prior to the specified date requirement?

A
ann 5/27/2010

Hi,
use BeforeAdd/BeforeEdit on the Events tab to prevent adding order with wrong date (14 days old).

Here is a sample code:

if (((strtotime($values["DateField"])-strtotime(now()))/60*60*24*14<1)||(!$values["DateField"]))

{return true;}

else

{return false;/*here you can put some message*/}
M
mfred author 5/28/2010

Will this also apply to the calendar selector or just the field entry?

A
ann 5/31/2010

Hi,
no, it's not. These changes applies to the date which is already in the database and implement when Save button is pressed.