From 8d706b62d9b091057d168a387b37acd399191a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristia=CC=81n=20Feldsam?= Date: Sun, 28 Apr 2019 17:04:01 +0200 Subject: [PATCH] DateRangePicker added Quarters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristián Feldsam --- app/Ninja/Presenters/AccountPresenter.php | 2 ++ resources/lang/cs/texts.php | 2 ++ resources/lang/en/texts.php | 2 ++ resources/views/clients/statement.blade.php | 1 + resources/views/dashboard.blade.php | 1 + resources/views/reports/emails.blade.php | 1 + resources/views/reports/report_builder.blade.php | 1 + 7 files changed, 10 insertions(+) diff --git a/app/Ninja/Presenters/AccountPresenter.php b/app/Ninja/Presenters/AccountPresenter.php index 2f75a3f056..d675b8d416 100644 --- a/app/Ninja/Presenters/AccountPresenter.php +++ b/app/Ninja/Presenters/AccountPresenter.php @@ -169,6 +169,8 @@ class AccountPresenter extends Presenter "' . trans('texts.last_30_days') . '": [moment().subtract(29, "days"), moment()], "' . trans('texts.this_month') . '": [moment().startOf("month"), moment().endOf("month")], "' . trans('texts.last_month') . '": [moment().subtract(1, "month").startOf("month"), moment().subtract(1, "month").endOf("month")], + "' . trans('texts.current_quarter') . '": [moment().quarter(chartQuarter).startOf("quarter"), moment().quarter(chartQuarter).endOf("quarter")], + "' . trans('texts.last_quarter') . '": [moment().subtract(1, "quarter").startOf("quarter"), moment().subtract(1, "quarter").endOf("quarter")], "' . trans('texts.this_year') . '": [moment().date(1).month(' . $month . ').year(' . $year . '), moment()], "' . trans('texts.last_year') . '": [moment().date(1).month(' . $month . ').year(' . $lastYear . '), moment().date(1).month(' . $month . ').year(' . $year . ').subtract(1, "day")], }'; diff --git a/resources/lang/cs/texts.php b/resources/lang/cs/texts.php index e04aaf51ee..0552cb7136 100644 --- a/resources/lang/cs/texts.php +++ b/resources/lang/cs/texts.php @@ -2067,6 +2067,8 @@ $LANG = array( 'last_30_days' => 'Poslední měsíc', 'this_month' => 'Tento měsíc', 'last_month' => 'Last Month', + 'current_quarter' => 'Aktuální čtvrtletí', + 'last_quarter' => 'Poslední čtvrtletí', 'last_year' => 'Last Year', 'custom_range' => 'Custom Range', 'url' => 'URL', diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 2ffc21cfc3..9bbdd40dc8 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2065,6 +2065,8 @@ $LANG = array( 'last_30_days' => 'Last 30 Days', 'this_month' => 'This Month', 'last_month' => 'Last Month', + 'current_quarter' => 'Current Quarter', + 'last_quarter' => 'Last Quarter', 'last_year' => 'Last Year', 'custom_range' => 'Custom Range', 'url' => 'URL', diff --git a/resources/views/clients/statement.blade.php b/resources/views/clients/statement.blade.php index 9ceee6cfb1..0db2e1b55d 100644 --- a/resources/views/clients/statement.blade.php +++ b/resources/views/clients/statement.blade.php @@ -22,6 +22,7 @@ var statementStartDate = moment("{{ $startDate }}"); var statementEndDate = moment("{{ $endDate }}"); + var chartQuarter = moment().quarter(); var dateRanges = {!! $account->present()->dateRangeOptions !!}; function getPDFString(cb) { diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index e4d3c51e8d..f9621b127d 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -86,6 +86,7 @@ var account = {!! $account !!}; var chartGroupBy = 'day'; var chartCurrencyId = {{ $account->getCurrencyId() }}; + var chartQuarter = moment().quarter(); var dateRanges = {!! $account->present()->dateRangeOptions !!}; var chartStartDate; var chartEndDate; diff --git a/resources/views/reports/emails.blade.php b/resources/views/reports/emails.blade.php index 0c3cf72876..6096f2ed22 100644 --- a/resources/views/reports/emails.blade.php +++ b/resources/views/reports/emails.blade.php @@ -92,6 +92,7 @@ } var account = {!! $account !!}; + var chartQuarter = moment().quarter(); var dateRanges = {!! $account->present()->dateRangeOptions !!}; var chartStartDate; var chartEndDate; diff --git a/resources/views/reports/report_builder.blade.php b/resources/views/reports/report_builder.blade.php index 6fe4109004..27af94057a 100644 --- a/resources/views/reports/report_builder.blade.php +++ b/resources/views/reports/report_builder.blade.php @@ -63,6 +63,7 @@ var chartStartDate = moment("{{ $startDate }}"); var chartEndDate = moment("{{ $endDate }}"); + var chartQuarter = moment().quarter(); var dateRanges = {!! $account->present()->dateRangeOptions !!}; function resolveRange(range) {