Skip to content

Commit

Permalink
Remove global setting of UserDateHelper format
Browse files Browse the repository at this point in the history
It was global setting and it affected all instances loaded by constructor.

Change doesn't affect `userDate` latte macro.

remp/crm#1781
  • Loading branch information
markoph committed Mar 12, 2021
1 parent 9f6a9e5 commit db84a4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/model/Repository/InvoicesRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public function __construct(
$this->addressesRepository = $addressesRepository;
$this->invoiceItemsRepository = $invoiceItemsRepository;
$this->auditLogRepository = $auditLogRepository;
$userDateHelper->setFormat([IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT]);
$this->userDateHelper = $userDateHelper;
$this->userDateHelper = clone $userDateHelper;
$this->userDateHelper->setFormat([IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT]);
$this->paymentItemsRepository = $paymentItemsRepository;
}

Expand Down

0 comments on commit db84a4a

Please sign in to comment.