mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-05 03:34:36 -04:00
Minor fixes for date range calculation for :WEEK
This commit is contained in:
parent
fd3d9aa931
commit
c9bebde8f4
@ -114,7 +114,7 @@ class Helpers
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 04-10-2022 Return Early if no reserved keywords are present, this is a very expenseive process
|
// 04-10-2022 Return Early if no reserved keywords are present, this is a very expensive process
|
||||||
$string_hit = false;
|
$string_hit = false;
|
||||||
|
|
||||||
foreach ( [':MONTH',':YEAR',':QUARTER',':WEEK'] as $string )
|
foreach ( [':MONTH',':YEAR',':QUARTER',':WEEK'] as $string )
|
||||||
@ -144,21 +144,21 @@ class Helpers
|
|||||||
':QUARTER' => 'Q'.now()->quarter,
|
':QUARTER' => 'Q'.now()->quarter,
|
||||||
':WEEK_BEFORE' => \sprintf(
|
':WEEK_BEFORE' => \sprintf(
|
||||||
'%s %s %s',
|
'%s %s %s',
|
||||||
Carbon::now()->subDays(7)->translatedFormat($entity->date_format()),
|
Carbon::now()->subDays(6)->translatedFormat($entity->date_format()),
|
||||||
ctrans('texts.to'),
|
ctrans('texts.to'),
|
||||||
Carbon::now()->translatedFormat($entity->date_format())
|
Carbon::now()->translatedFormat($entity->date_format())
|
||||||
),
|
),
|
||||||
':WEEK_AHEAD' => \sprintf(
|
':WEEK_AHEAD' => \sprintf(
|
||||||
'%s %s %s',
|
'%s %s %s',
|
||||||
Carbon::now()->addDays(7)->translatedFormat($entity->date_format()),
|
Carbon::now()->addDays(6)->translatedFormat($entity->date_format()),
|
||||||
ctrans('texts.to'),
|
ctrans('texts.to'),
|
||||||
Carbon::now()->addDays(14)->translatedFormat($entity->date_format())
|
Carbon::now()->addDays(13)->translatedFormat($entity->date_format())
|
||||||
),
|
),
|
||||||
':WEEK' => \sprintf(
|
':WEEK' => \sprintf(
|
||||||
'%s %s %s',
|
'%s %s %s',
|
||||||
Carbon::now()->translatedFormat($entity->date_format()),
|
Carbon::now()->translatedFormat($entity->date_format()),
|
||||||
ctrans('texts.to'),
|
ctrans('texts.to'),
|
||||||
Carbon::now()->addDays(7)->translatedFormat($entity->date_format())
|
Carbon::now()->addDays(6)->translatedFormat($entity->date_format())
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
'raw' => [
|
'raw' => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user