Skip to content

Commit

Permalink
Merge pull request #14262 from francescbassas/patch-16
Browse files Browse the repository at this point in the history
dev/core#964 Add start date and end date values on page contribution widget ajax response
  • Loading branch information
colemanw authored May 19, 2019
2 parents d53686b + 9730163 commit 0af0b7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CRM/Contribute/BAO/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static function getContributionPageData($contributionPageID, $widgetID, $
$now = time();
if ($dao->start_date) {
$startDate = CRM_Utils_Date::unixTime($dao->start_date);
$data['start_date'] = $dao->start_date;
if ($startDate && $startDate >= $now) {
$data['is_active'] = FALSE;
$data['campaign_start'] = ts('Campaign starts on %1', [
Expand All @@ -137,6 +138,7 @@ public static function getContributionPageData($contributionPageID, $widgetID, $

if ($dao->end_date) {
$endDate = CRM_Utils_Date::unixTime($dao->end_date);
$data['end_date'] = $dao->end_date;
if ($endDate &&
$endDate < $now
) {
Expand Down

0 comments on commit 0af0b7b

Please sign in to comment.