Skip to content

Commit 53925e5

Browse files
authored
Merge pull request #186 from dblazeski/2.1
Fixes Y-d-m format
2 parents 25bf656 + 9467b88 commit 53925e5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/Tmdb/Model/Person.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,12 @@ public function getChanges()
265265
public function setDeathday($deathday)
266266
{
267267
if (!$deathday instanceof \DateTime && !empty($deathday)) {
268-
$deathday = new \DateTime($deathday);
268+
// Is the format Y-m-d ?
269+
if(strtotime($deathday) === false) {
270+
$deathday = \DateTime::createFromFormat('Y-d-m', $deathday);
271+
} else {
272+
$deathday = new \DateTime($deathday);
273+
}
269274
}
270275

271276
if (empty($deathday)) {

0 commit comments

Comments
 (0)