diff --git a/CRM/Member/Page/DashBoard.php b/CRM/Member/Page/DashBoard.php index a0a6e4bb033d..cc6d8e6a57c2 100644 --- a/CRM/Member/Page/DashBoard.php +++ b/CRM/Member/Page/DashBoard.php @@ -428,7 +428,7 @@ public function preProcess() { $this->assign('membershipSummary', $membershipSummary); $this->assign('totalCount', $totalCount); - $this->assign('month', CRM_Utils_Date::customFormat($monthStartTs, '%B')); + $this->assign('month', CRM_Utils_Date::customFormatTs($monthStartTs, '%B')); $this->assign('year', date('Y', $monthStartTs)); $this->assign('premonth', CRM_Utils_Date::customFormat($preMonth, '%B')); $this->assign('currentMonth', date('F')); diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index 74aa2e35caec..a9795c42f06a 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -438,6 +438,23 @@ public static function customFormat($dateString, $format = NULL, $dateParts = NU } } + /** + * Wrapper for customFormat that takes a timestamp + * + * @param int $timestamp + * Date and time in timestamp format. + * @param string $format + * The output format. + * @param array $dateParts + * An array with the desired date parts. + * + * @return string + * the $format-formatted $date + */ + public static function customFormatTs($timestamp, $format = NULL, $dateParts = NULL) { + return CRM_Utils_Date::customFormat(date("Y-m-d H:i:s", $timestamp), $format, $dateParts); + } + /** * Converts the date/datetime from MySQL format to ISO format * diff --git a/templates/CRM/Member/Page/DashBoard.tpl b/templates/CRM/Member/Page/DashBoard.tpl index 3b56964fe309..1dbf86d8530f 100644 --- a/templates/CRM/Member/Page/DashBoard.tpl +++ b/templates/CRM/Member/Page/DashBoard.tpl @@ -30,7 +30,7 @@ {ts}Members by Type{/ts} {if $preMonth} - {$premonth} – {ts}(Last Month){/ts} + {$premonth} {ts}(Last Month){/ts} {/if} {$month}{if $isCurrent}{ts} (MTD){/ts}{/if}