From: Vincent Vanwaelscappel Date: Fri, 9 Jun 2023 17:38:12 +0000 (+0200) Subject: wip #5877 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=193b4d67f85280e704b2010d2d7ef2fccbded357;p=fluidbook-toolbox.git wip #5877 @0.5 --- 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')); });