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

fix date

parent bf65be54
Branches
No related tags found
No related merge requests found
...@@ -16,8 +16,8 @@ class DateField extends Field ...@@ -16,8 +16,8 @@ class DateField extends Field
$ret = true; $ret = true;
$this->value = $_POST[$this->name]; $this->value = $_POST[$this->name];
$year = substr($this->value, 0, 4); $year = substr($this->value, 0, 4);
$month = substr($this->value, 6, 2); $month = substr($this->value, 5, 2);
$day = substr($this->value, 9, 2); $day = substr($this->value, 8, 2);
$today = getdate(); $today = getdate();
if ($year < $today[year]) { if ($year < $today[year]) {
$ret = false; $ret = false;
...@@ -31,8 +31,8 @@ class DateField extends Field ...@@ -31,8 +31,8 @@ class DateField extends Field
public function show() { public function show() {
$year = substr($this->value, 0, 4); $year = substr($this->value, 0, 4);
$month = substr($this->value, 6, 2); $month = substr($this->value, 5, 2);
$day = substr($this->value, 9, 2); $day = substr($this->value, 8, 2);
$html = $day.'-'.$month.'-'.$year; $html = $day.'-'.$month.'-'.$year;
return $html; return $html;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment