mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 14:26:58 +00:00
Update the ranges to reflect the current dates.
This commit is contained in:
@@ -9,6 +9,7 @@ use Illuminate\Contracts\Auth\Guard;
|
|||||||
use Navigation;
|
use Navigation;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Session;
|
use Session;
|
||||||
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SessionFilter
|
* Class SessionFilter
|
||||||
@@ -68,6 +69,14 @@ class Range
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set current / next / prev month.
|
||||||
|
$current = Carbon::now()->format('F Y');
|
||||||
|
$next = Carbon::now()->endOfMonth()->addDay()->format('F Y');
|
||||||
|
$prev = Carbon::now()->startOfMonth()->subDay()->format('F Y');
|
||||||
|
View::share('currentMonthName', $current);
|
||||||
|
View::share('previousMonthName', $prev);
|
||||||
|
View::share('nextMonthName', $next);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,14 +2,21 @@ $(function () {
|
|||||||
|
|
||||||
$('.currencySelect').click(currencySelect);
|
$('.currencySelect').click(currencySelect);
|
||||||
|
|
||||||
|
ranges = {};
|
||||||
|
ranges[currentMonthName] = [moment().startOf('month'), moment().endOf('month')];
|
||||||
|
ranges[previousMonthName] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')];
|
||||||
|
ranges[nextMonthName] = [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')];
|
||||||
|
ranges['Everything'] = [firstDate, moment()];
|
||||||
|
|
||||||
$('#daterange').daterangepicker(
|
$('#daterange').daterangepicker(
|
||||||
{
|
{
|
||||||
ranges: {
|
//View::share('currentMonthName', $current);
|
||||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
//View::share('previousMonthName', $prev);
|
||||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
|
//View::share('nextMonthName', $next);
|
||||||
'Next Month': [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')],
|
|
||||||
'Everything': [firstDate, moment()]
|
|
||||||
},
|
ranges: ranges
|
||||||
|
,
|
||||||
opens: 'left',
|
opens: 'left',
|
||||||
|
|
||||||
format: 'DD-MM-YYYY',
|
format: 'DD-MM-YYYY',
|
||||||
|
@@ -132,6 +132,9 @@
|
|||||||
var dateRangeURL = "{{route('daterange')}}";
|
var dateRangeURL = "{{route('daterange')}}";
|
||||||
var token = "{{csrf_token()}}";
|
var token = "{{csrf_token()}}";
|
||||||
var firstDate = moment("{{Session::get('first')->format('Y-m-d')}}");
|
var firstDate = moment("{{Session::get('first')->format('Y-m-d')}}");
|
||||||
|
var currentMonthName = "{{$currentMonthName}}";
|
||||||
|
var previousMonthName = "{{$previousMonthName}}";
|
||||||
|
var nextMonthName = "{{$nextMonthName}}";
|
||||||
$('#daterange span').text(titleString);
|
$('#daterange span').text(titleString);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user