1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-15 10:34:06 +02:00

Add support for DateTimeInterface

This commit is contained in:
Patrik Votocek
2014-03-24 15:37:25 +01:00
committed by David Grudl
parent 0071b80938
commit 176b1a8895
13 changed files with 35 additions and 13 deletions

View File

@@ -235,7 +235,7 @@ class DibiSqlite3Driver extends DibiObject implements IDibiDriver, IDibiResultDr
case dibi::DATE:
case dibi::DATETIME:
if (!$value instanceof DateTime) {
if (!$value instanceof DateTime && !$value instanceof DateTimeInterface) {
$value = new DibiDateTime($value);
}
return $value->format($type === dibi::DATETIME ? $this->fmtDateTime : $this->fmtDate);