Renamed fields #267

This commit is contained in:
James Cole
2016-06-11 06:36:46 +02:00
parent b80d8cf774
commit 307e6a2337
3 changed files with 16 additions and 14 deletions

View File

@@ -94,12 +94,14 @@ class Range
private function datePicker() private function datePicker()
{ {
$current = Carbon::now()->formatLocalized('%B %Y'); $current = Carbon::now()->formatLocalized('%B %Y');
$next = Carbon::now()->endOfMonth()->addDay()->formatLocalized('%B %Y'); $next = Carbon::now()->endOfMonth()->addDay()->formatLocalized('%B %Y');
$prev = Carbon::now()->startOfMonth()->subDay()->formatLocalized('%B %Y'); $prev = Carbon::now()->startOfMonth()->subDay()->formatLocalized('%B %Y');
View::share('currentMonthName', $current); View::share('currentPeriodName', $current);
View::share('previousMonthName', $prev); View::share('previousPeriodName', $prev);
View::share('nextMonthName', $next); View::share('nextPeriodName', $next);
} }
} }

View File

@@ -6,14 +6,14 @@ $(function () {
$('.currency-option').click(currencySelect); $('.currency-option').click(currencySelect);
var ranges = {}; var ranges = {};
// range for the current month: // range for the current period:
ranges[dateRangeConfig.currentMonth] = [moment().startOf('month'), moment().endOf('month')]; ranges[dateRangeConfig.currentPeriod] = [moment().startOf('month'), moment().endOf('month')];
// range for the previous month: // range for the previous period:
ranges[dateRangeConfig.previousMonth] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]; ranges[dateRangeConfig.previousPeriod] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')];
// range for the next month: // range for the next period:
ranges[dateRangeConfig.nextMonth] = [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')]; ranges[dateRangeConfig.nextPeriod] = [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')];
// range for everything: // range for everything:
ranges[dateRangeConfig.everything] = [dateRangeConfig.firstDate, moment()]; ranges[dateRangeConfig.everything] = [dateRangeConfig.firstDate, moment()];
@@ -48,10 +48,10 @@ $(function () {
label: label, label: label,
_token: token _token: token
}).done(function () { }).done(function () {
console.log('Succesfully sent new date range.'); console.log('Succesfully sent new date range [' + start.format('YYYY-MM-DD') + '-' + end.format('YYYY-MM-DD') + '].');
window.location.reload(true); window.location.reload(true);
}).fail(function () { }).fail(function () {
console.log('Could not send new date range.'); console.log('Could not send new date range [' + start.format('YYYY-MM-DD') + '-' + end.format('YYYY-MM-DD') + ']');
alert('Could not change date range'); alert('Could not change date range');
}); });

View File

@@ -172,9 +172,9 @@
linkTitle: "{{ Session.get('start').formatLocalized(monthAndDayFormat) }} - {{ Session.get('end').formatLocalized(monthAndDayFormat) }}", linkTitle: "{{ Session.get('start').formatLocalized(monthAndDayFormat) }} - {{ Session.get('end').formatLocalized(monthAndDayFormat) }}",
URL: "{{ route('daterange') }}", URL: "{{ route('daterange') }}",
firstDate: moment("{{ Session.get('first').format('Y-m-d') }}"), firstDate: moment("{{ Session.get('first').format('Y-m-d') }}"),
currentMonth: "{{ currentMonthName }}", currentPeriod: "{{ currentPeriodName }}",
previousMonth: "{{ previousMonthName }}", previousPeriod: "{{ previousPeriodName }}",
nextMonth: "{{ nextMonthName }}", nextPeriod: "{{ nextPeriodName }}",
everything: '{{ 'everything'|_ }}', everything: '{{ 'everything'|_ }}',
customRangeLabel: '{{ 'customRange'|_ }}', customRangeLabel: '{{ 'customRange'|_ }}',
applyLabel: '{{ 'apply'|_ }}', applyLabel: '{{ 'apply'|_ }}',