mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 22:26:43 +02:00
Add support for DateTimeInterface
This commit is contained in:
committed by
David Grudl
parent
0071b80938
commit
176b1a8895
@@ -294,7 +294,7 @@ class DibiPostgreDriver 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 ? "'Y-m-d H:i:s'" : "'Y-m-d'");
|
||||
|
Reference in New Issue
Block a user