<?php
-
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
/*
date validation and parsing functions
$year = substr($date_,0,4);
}
}
- if ((int)$year > 9999)
+ if (!isset($year)|| (int)$year > 9999)
{
return 0;
}
list($year, $month, $day) = jalali_to_gregorian($year, $month, $day);
else if ($date_system == 2)
list($year, $month, $day) = islamic_to_gregorian($year, $month, $day);
- return $year."/".$month."/".$day;
+ return $year."-".$month."-".$day;
}// end of function
function date1_greater_date2 ($date1, $date2)
$date1 = date2sql($date1);
$date2 = date2sql($date2);
- list($year1, $month1, $day1) = explode("/", $date1);
- list($year2, $month2, $day2) = explode("/", $date2);
+ list($year1, $month1, $day1) = explode("-", $date1);
+ list($year2, $month2, $day2) = explode("-", $date2);
if ($year1 > $year2)
{
$date1 = date2sql($date1);
$date2 = date2sql($date2);
- list($year1, $month1, $day1) = explode("/", $date1);
- list($year2, $month2, $day2) = explode("/", $date2);
+ list($year1, $month1, $day1) = explode("-", $date1);
+ list($year2, $month2, $day2) = explode("-", $date2);
$stamp1 = mktime(0,0,0, (int)$month1, (int)$day1, (int)$year1);
$stamp2 = mktime(0,0,0, (int)$month2, (int)$day2, (int)$year2);
echo "<br>Dates must be entered in the format $disp. Sent was $date_<br>";
exit;
}
- list($year, $month, $day) = explode("/", $date);
+ list($year, $month, $day) = explode("-", $date);
return array($day, $month, $year);
}