]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5877 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 9 Jun 2023 17:38:12 +0000 (19:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 9 Jun 2023 17:38:12 +0000 (19:38 +0200)
resources/views/fluidbook_stats/summary.blade.php

index b20b4bf59e17c3a078c1770ed30ed8fbe5eb000f..3a6737e2df8481d3433232c9bac80bcbcde4d723 100644 (file)
             });
             @endif
 
+            let creationDate = moment('{{ $fluidbook->created_at->isoFormat('YYYY-MM-DD') }}');
+            let now = moment();
+
             $('[data-daterangepicker]').daterangepicker({
                 "locale": {
                     "format": "DD/MM/YYYY",
                         "{{__('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'));
             });