Permalink
Browse files

Use system configuration to format dates. (#4477)

Looks good to me.

It won't pass tests until I merge.

* Use system configuration to format dates.

* Pass in dummy arguments to FormatBirthDate to correct parameter count.
  • Loading branch information...
btdn authored and crossan007 committed Sep 14, 2018
1 parent 1f589c4 commit 4de9e76a4e07286278503acf6b6f5123d5487586
Showing with 6 additions and 8 deletions.
  1. +6 −8 src/Reports/ConfirmReport.php
@@ -14,6 +14,7 @@
use ChurchCRM\dto\SystemConfig;
use ChurchCRM\Reports\ChurchInfoReport;
use ChurchCRM\Utils\MiscUtils;
class PDF_ConfirmReport extends ChurchInfoReport
{
@@ -149,7 +150,9 @@ public function FinishPage($curY)
$pdf->SetFont('Times', 'B', 10);
$pdf->WriteAtCell(SystemConfig::getValue('leftX'), $curY, $dataCol - SystemConfig::getValue('leftX'), gettext('Anniversary Date'));
$pdf->SetFont('Times', '', 10);
$pdf->WriteAtCell($dataCol, $curY, $dataWid, FormatDate($fam_WeddingDate));
if ($fam_WeddingDate != "") {
$pdf->WriteAtCell($dataCol, $curY, $dataWid, date_format(date_create($fam_WeddingDate), SystemConfig::getValue("sDateFormatLong")));
}
$curY += SystemConfig::getValue('incrementY');
$pdf->SetFont('Times', 'B', 10);
@@ -215,13 +218,8 @@ public function FinishPage($curY)
$pdf->WriteAtCell($XGender, $curY, $XRole - $XGender, $genderStr);
$pdf->WriteAtCell($XRole, $curY, $XEmail - $XRole, $sFamRole);
$pdf->WriteAtCell($XEmail, $curY, $XBirthday - $XEmail, $per_Email);
if ($per_BirthYear) {
$birthdayStr = $per_BirthYear.'-'.$per_BirthMonth.'-'.$per_BirthDay;
} elseif ($per_BirthMonth) {
$birthdayStr = $per_BirthMonth.'-'.$per_BirthDay;
} else {
$birthdayStr = '';
}
$birthdayStr = MiscUtils::FormatBirthDate($per_BirthYear, $per_BirthMonth, $per_BirthDay, $null, $null);
//If the "HideAge" check box is true, then create a Yes/No representation of the check box.
if ($per_Flags) {
$hideAgeStr = gettext('Yes');

0 comments on commit 4de9e76

Please sign in to comment.