| |
|
Tutorial - EnabledDateExpression property
|
| | |
Calendar can disable certain dates based on a javascript expression you provide with EnabledDateExpression property.
This expression is evaluated for every day to be rendered.
When expression evaluates to true, the date to be rendered is enableld. If false, then disabled.
| | |
Example
This example evaluates to false for every date.
<obout:Calendar runat="server" StyleFolder="/calendar/styles/default" EnabledDateExpression="false"> </obout:Calendar>
|
|
| | |
Example
This example only enables Tuesdays and Thursdays.
currentDate is the javascript Date type variable that is used to render each day.
<obout:Calendar runat="server" StyleFolder="/calendar/styles/default" EnabledDateExpression="currentDate.getDay()==2 || currentDate.getDay()==4"> </obout:Calendar>
|
|
| | |
Example
This expression evaluates to true only if date is even.
<obout:Calendar runat="server" StyleFolder="/calendar/styles/default" EnabledDateExpression="currentDate.getDate() % 2 == 0"> </obout:Calendar>
|
|
| | |
Example
This expression evaluates to true only if date is equal to variable.
Declare the client variable inside your head element. <script language="text/javascript"> var dateVariable = 3; </script> <obout:Calendar runat="server" StyleFolder="/calendar/styles/default" EnabledDateExpression="currentDate.getDate() == dateVariable"> </obout:Calendar>
|
|
| | |
Example
This expression evaluates to true only if function returns true.
Declare the client function inside your head element. <script language="text/javascript"> function ValidateDate(currentDate) { if (currentDate.getDate() % 3 == 0) return true; return false; } </script> <obout:Calendar runat="server" StyleFolder="/calendar/styles/default" EnabledDateExpression="ValidateDate(currentDate)"> </obout:Calendar>
|
|
| | |
Example
This expression evaluates to true only if function returns true.
Specific year date is disabled, 10 December 2008.
Declare the client function inside your head element. <script language="text/javascript"> function ValidateDate(currentDate) { if (currentDate.getDate() == 10 && currentDate.getMonth() == 11 && currentDate.getFullYear() == 2008) return false; return true; } </script> <obout:Calendar runat="server" StyleFolder="/calendar/styles/default" EnabledDateExpression="ValidateDate(currentDate)"> </obout:Calendar>
|
|
| | |
Example
This expression evaluates to true only if function returns true.
Specific day of week is disabled, Sunday.
Declare the client function inside your head element. <script language="text/javascript"> function ValidateDate(currentDate) { if (currentDate.getDay() == 0) return false; return true; } </script> <obout:Calendar runat="server" StyleFolder="/calendar/styles/default" EnabledDateExpression="ValidateDate(currentDate)"> </obout:Calendar>
|
|
| | |
| "Quality of products and support you guys provide is matchless. I’m very pleased with the service you guys provide and I want you to know that I’ll make sure all my programmer friends will know about your first-class company.
" |
Ion Despoiu |
| CB Mills, Division of Chicago Boiler |
| | |
|
|
|
|