Skip to content

Commit

Permalink
Allow inserting DateTime objects as date param
Browse files Browse the repository at this point in the history
  • Loading branch information
ngroot committed Apr 6, 2016
1 parent 63fec9f commit 1db823b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/CAC/Component/ESP/Api/Engine/EngineApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public function sendMailing($mailingId, array $users, $date = null, $mailinglist
{
if (null === $date) {
$date = date("Y-m-d H:i:s");
} elseif ($date instanceof \DateTime) {
$date = $date->format("Y-m-d H:i:s");
}

if (null === $mailinglistId) {
Expand Down Expand Up @@ -182,6 +184,8 @@ public function sendMailingWithAttachment($mailingId, array $user, $date = null,
{
if (null === $date) {
$date = date("Y-m-d H:i:s");
} elseif ($date instanceof \DateTime) {
$date = $date->format("Y-m-d H:i:s");
}

if (null === $mailinglistId) {
Expand Down

0 comments on commit 1db823b

Please sign in to comment.