Commit 0c336901 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #56 from stefanklug/postgresDateFixes

Reopened on feature branch: Fix Postgres Date Add/Sub functions for dynamic values
parents 5b11f34f 63134943
...@@ -99,22 +99,22 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -99,22 +99,22 @@ class PostgreSqlPlatform extends AbstractPlatform
public function getDateAddDaysExpression($date, $days) public function getDateAddDaysExpression($date, $days)
{ {
return "(" . $date . "+ interval '" . $days . " day')"; return "(" . $date ." + (" . $days . " || ' day')::interval)";
} }
public function getDateSubDaysExpression($date, $days) public function getDateSubDaysExpression($date, $days)
{ {
return "(" . $date . "- interval '" . $days . " day')"; return "(" . $date ." - (" . $days . " || ' day')::interval)";
} }
public function getDateAddMonthExpression($date, $months) public function getDateAddMonthExpression($date, $months)
{ {
return "(" . $date . "+ interval '" . $months . " month')"; return "(" . $date ." + (" . $months . " || ' month')::interval)";
} }
public function getDateSubMonthExpression($date, $months) public function getDateSubMonthExpression($date, $months)
{ {
return "(" . $date . "- interval '" . $months . " month')"; return "(" . $date ." - (" . $months . " || ' month')::interval)";
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment