Commit bbf1b47d authored by Stefan Klug's avatar Stefan Klug

fixed date add and subtract functions for dynamic values

parent 82cc9214
......@@ -99,22 +99,22 @@ class PostgreSqlPlatform extends AbstractPlatform
public function getDateAddDaysExpression($date, $days)
{
return "(" . $date . "+ interval '" . $days . " day')";
return "($date + ($days || ' day')::interval)";
}
public function getDateSubDaysExpression($date, $days)
{
return "(" . $date . "- interval '" . $days . " day')";
return "($date - ($days || ' day')::interval)";
}
public function getDateAddMonthExpression($date, $months)
{
return "(" . $date . "+ interval '" . $months . " month')";
return "($date + ($months || ' month')::interval)";
}
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