The function CheckFilterDates checks if the two dates are correct and
compares them. Usually the function is used in filters to check if the inputted
time interval is correct.
Parameters
Parameter
Description
date1
The first date interval (from).
date2
The second date interval (till).
is_date1_wrong
This parameter is a reference to an original variable. If it contains
"Y" on return, the date specified in the parameter date1
is incorrect for the date format of the current site (language).
is_date2_wrong
This parameter is a reference to an original variable. If it contains
"Y" on return, the date specified in the parameter date2
is incorrect for the date format of the current site (language).
is_date2_less_date1
This parameter is a reference to an original variable. If it contains
"Y" on return, the date specified in the parameter date1 is
greater than that in date2, which is incorrect if a time interval
is being specified.
<?
CheckFilterDates("10.01.2003", "15.02.2004", $date1_wrong, $date2_wrong, $date2_less);
if ($date1_wrong=="Y") echo "Incorrect format of the date1!!";
if ($date2_wrong=="Y") echo "Incorrect format of the date2!!";
if ($date2_less=="Y") echo "The date1 is greater than the date2!!";
?>