1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Merge pull request #6422 from beganovich/v5-603

(v5) Support for weekly notations
This commit is contained in:
Benjamin Beganović 2021-08-06 14:16:17 +02:00 committed by GitHub
commit 4d4f32c98f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -358,6 +358,24 @@ trait MakesInvoiceValues
':MONTH' => Carbon::createFromDate(now()->year, now()->month)->translatedFormat('F'),
':YEAR' => now()->year,
':QUARTER' => 'Q' . now()->quarter,
':WEEK_BEFORE' => \sprintf(
'%s %s %s',
Carbon::now()->subDays(7)->translatedFormat($this->client->date_format()),
ctrans('texts.to'),
Carbon::now()->translatedFormat($this->client->date_format())
),
':WEEK_AHEAD' => \sprintf(
'%s %s %s',
Carbon::now()->addDays(7)->translatedFormat($this->client->date_format()),
ctrans('texts.to'),
Carbon::now()->addDays(14)->translatedFormat($this->client->date_format())
),
':WEEK' => \sprintf(
'%s %s %s',
Carbon::now()->translatedFormat($this->client->date_format()),
ctrans('texts.to'),
Carbon::now()->addDays(7)->translatedFormat($this->client->date_format())
),
],
'raw' => [
':MONTH' => now()->month,