From 193b4d67f85280e704b2010d2d7ef2fccbded357 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 9 Jun 2023 19:38:12 +0200 Subject: [PATCH] wip #5877 @0.5 --- .../views/fluidbook_stats/summary.blade.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/resources/views/fluidbook_stats/summary.blade.php b/resources/views/fluidbook_stats/summary.blade.php index b20b4bf59..3a6737e2d 100644 --- a/resources/views/fluidbook_stats/summary.blade.php +++ b/resources/views/fluidbook_stats/summary.blade.php @@ -267,6 +267,9 @@ }); @endif + let creationDate = moment('{{ $fluidbook->created_at->isoFormat('YYYY-MM-DD') }}'); + let now = moment(); + $('[data-daterangepicker]').daterangepicker({ "locale": { "format": "DD/MM/YYYY", @@ -299,14 +302,21 @@ "{{__('Octrobe')}}", "{{__('Novembre')}}", "{{__('Décembre')}}", - ], + "firstDay": 0 }, - minDate: moment('{{ $fluidbook->created_at->isoFormat('YYYY-MM-DD') }}'), // Creation date of the Fluidbook - maxDate: moment(), + minDate: creationDate, // Creation date of the Fluidbook + maxDate: now, startDate: moment('{{ $start_date }}'), endDate: moment('{{ $end_date }}'), + ranges: { + '{{__('Ce mois')}}': [moment().startOf('month'), now], + '{{__('Les 30 derniers jours')}}': [moment().subtract(29, 'days'), moment()], + '{{__('Cette année')}}': [moment().startOf('year'), now], + '{{__('Depuis la création')}}': [creationDate, now], + }, + "alwaysShowCalendars": true, }, function (start, end) { $('[data-daterangepicker] span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); }); -- 2.39.5