X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FHistory.php;h=116b9264019c2a667e19f2d1e47aee0d5ab0b362;hb=813849e5216cb87121e0f778a734575be6a36052;hp=f93b03568235c1f71ecc7d9d86b21e0a56fab34b;hpb=a4af59f47103a3f9c903eeddb1e30ab9cb7344f0;p=github%2Fshaarli%2FShaarli.git diff --git a/application/History.php b/application/History.php index f93b0356..116b9264 100644 --- a/application/History.php +++ b/application/History.php @@ -135,7 +135,7 @@ class History $item = [ 'event' => $status, - 'datetime' => (new DateTime())->format(DateTime::ATOM), + 'datetime' => new DateTime(), 'id' => $id !== null ? $id : '', ]; $this->history = array_merge([$item], $this->history); @@ -177,7 +177,7 @@ class History { $comparaison = new DateTime('-'. $this->retentionTime . ' seconds'); foreach ($this->history as $key => $value) { - if (DateTime::createFromFormat(DateTime::ATOM, $value['datetime']) < $comparaison) { + if ($value['datetime'] < $comparaison) { unset($this->history[$key]); } }