1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-10 16:14:57 +02:00

Add aposthrophes back to dates

Commit 7318658017 removed apostrophes from dates and that caused
dibi to build different queries. Compare:
...WHERE `date_created` < '2014-02-21';
vs.
...WHERE `date_created` < 2014-02-21;
This commit is contained in:
Erik Fercak
2014-02-21 14:08:07 +01:00
parent a6cc588d91
commit 7fc3d76072
7 changed files with 7 additions and 7 deletions

View File

@@ -282,7 +282,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
if (!$value instanceof DateTime) {
$value = new DibiDateTime($value);
}
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d");
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'");
default:
throw new InvalidArgumentException('Unsupported type.');