Use ISO8601 date format for duedate
Fixes issues with Date.parse on webkit based browsers closes #240 Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
38ec1abfa5
commit
1cbfd1b6bf
@@ -58,6 +58,13 @@ class Card extends RelationalEntity implements JsonSerializable {
|
||||
$this->addResolvable('owner');
|
||||
}
|
||||
|
||||
public function getDuedate() {
|
||||
if($this->duedate === null)
|
||||
return null;
|
||||
$dt = new DateTime($this->duedate);
|
||||
return $dt->format('c');
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
$json = parent::jsonSerialize();
|
||||
$json['overdue'] = self::DUEDATE_FUTURE;
|
||||
@@ -84,6 +91,7 @@ class Card extends RelationalEntity implements JsonSerializable {
|
||||
$json['overdue'] = self::DUEDATE_OVERDUE;
|
||||
}
|
||||
}
|
||||
$json['duedate'] = $this->getDuedate();
|
||||
return $json;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user