Skip to content
Snippets Groups Projects
Commit 982e543e authored by goujonpa's avatar goujonpa
Browse files

ultimate fix date

parent bdf1a443
No related branches found
No related tags found
No related merge requests found
......@@ -13,20 +13,8 @@ class DateField extends Field
public function validate()
{
$ret = true;
$this->value = $_POST[$this->name];
$year = substr($this->value, 0, 4);
$month = substr($this->value, 5, 2);
$day = substr($this->value, 8, 2);
$today = getdate();
if ($year < $today[year]) {
$ret = false;
} else if ( $year == $today[year] && $month < $today[mon] ){
$ret = false;
} else if ( $year == $today[year] && $month == $today[mon] && $day < $today[day]){
$ret = false;
}
return ret;
return true;
}
public function show() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment