Fixes for localizing dates for reset counter

This commit is contained in:
= 2022-05-02 08:20:54 +10:00
parent b0ae010e42
commit 6709e5bbc4

View File

@ -643,7 +643,7 @@ trait GeneratesCounter
} }
$search = ['{$year}']; $search = ['{$year}'];
$replace = [date('Y')]; $replace = [Carbon::now($entity->company->timezone()->name)->format('Y')];
$search[] = '{$counter}'; $search[] = '{$counter}';
$replace[] = $counter; $replace[] = $counter;
@ -658,7 +658,7 @@ trait GeneratesCounter
$replace[] = $counter; $replace[] = $counter;
$search[] = '{$year}'; $search[] = '{$year}';
$replace[] = date('Y'); $replace = [Carbon::now($entity->company->timezone()->name)->format('Y')];
if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) { if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) {
$user_id = $entity->user_id ? $entity->user_id : 0; $user_id = $entity->user_id ? $entity->user_id : 0;