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

fix date

parent bf65be54
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,8 @@ class DateField extends Field
$ret = true;
$this->value = $_POST[$this->name];
$year = substr($this->value, 0, 4);
$month = substr($this->value, 6, 2);
$day = substr($this->value, 9, 2);
$month = substr($this->value, 5, 2);
$day = substr($this->value, 8, 2);
$today = getdate();
if ($year < $today[year]) {
$ret = false;
......@@ -31,8 +31,8 @@ class DateField extends Field
public function show() {
$year = substr($this->value, 0, 4);
$month = substr($this->value, 6, 2);
$day = substr($this->value, 9, 2);
$month = substr($this->value, 5, 2);
$day = substr($this->value, 8, 2);
$html = $day.'-'.$month.'-'.$year;
return $html;
}
......
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