SetDateLimits PowerScript function
Description
Sets the maximum and minimum date limits for the calendar.
Controls
MonthCalendar control
Syntax
1 |
<span>controlname</span>.<span>SetDateLimits </span> ( <span>min</span>, <span>max</span> ) |
Argument |
Description |
---|---|
controlname |
The name of the MonthCalendar control |
min |
A date value to be set as the minimum |
max |
A date value to be set as the maximum |
Return Values
Integer. Returns 0 when both limits are
set successfully and one of the following negative values otherwise:
-
-1
Invalid arguments
-2
Unknown failure
Usage
Use the SetDateLimits function to set minimum
and maximum dates. SetDateLimits uses the maximum
date as the minimum date and vice versa if you set a maximum date
that is earlier than the minimum date.
Examples
This example sets the minimum and maximum dates for
a control using today’s date as the minimum date and a
date specified in an EditMask control as the maximum date:
1 |
integer li_return<br>Date mindate, maxdate<br> <br>mindate = Today()<br>maxdate = Date(em_1.Text)<br>li_return = mc_1.SetDateLimits(mindate, maxdate) |