View | Details | Raw Unified | Return to bug 29229
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-35 / +33 lines)
Lines 1352-1397 Link Here
1352
                    $(this).parent().parent().find("ol").toggle();
1352
                    $(this).parent().parent().find("ol").toggle();
1353
                    return false;
1353
                    return false;
1354
                });
1354
                });
1355
                // http://jqueryui.com/demos/datepicker/#date-range
1355
1356
                var dates = $( "#suggesteddate_from, #suggesteddate_to" ).datepicker({
1356
                /* Suggested date fields */
1357
                    changeMonth: true,
1357
                var suggesteddate_from = $("#suggesteddate_from").flatpickr({
1358
                    numberOfMonths: 1,
1358
                    onClose: function( selectedDates, dateText, instance) {
1359
                    onSelect: function( selectedDate ) {
1359
                        validate_date( selectedDates, instance );
1360
                        var option = this.id == "suggesteddate_from" ? "minDate" : "maxDate",
1360
                        suggesteddate_to.set('minDate', selectedDates[0]);
1361
                            instance = $( this ).data( "datepicker" );
1362
                            date = $.datepicker.parseDate(
1363
                                instance.settings.dateFormat ||
1364
                                $.datepicker._defaults.dateFormat,
1365
                                selectedDate, instance.settings );
1366
                        dates.not( this ).datepicker( "option", option, date );
1367
                    }
1361
                    }
1368
                });
1362
                });
1369
                var datesMD = $( "#manageddate_from, #manageddate_to" ).datepicker({
1363
                var suggesteddate_to = $("#suggesteddate_to").flatpickr({
1370
                    changeMonth: true,
1364
                    onClose: function( selectedDates, dateText, instance) {
1371
                    numberOfMonths: 1,
1365
                        validate_date( selectedDates, instance );
1372
                    onSelect: function( selectedDate ) {
1366
                    },
1373
                        var option = this.id == "manageddate_from" ? "minDate" : "maxDate",
1367
                });
1374
                            instance = $( this ).data( "datepicker" );
1368
1375
                            date = $.datepicker.parseDate(
1369
                /* Managed date fields */
1376
                                instance.settings.dateFormat ||
1370
                var manageddate_from = $("#manageddate_from").flatpickr({
1377
                                $.datepicker._defaults.dateFormat,
1371
                    onClose: function( selectedDates, dateText, instance) {
1378
                                selectedDate, instance.settings );
1372
                        validate_date( selectedDates, instance );
1379
                        datesMD.not( this ).datepicker( "option", option, date );
1373
                        manageddate_to.set('minDate', selectedDates[0]);
1380
                    }
1374
                    }
1381
                });
1375
                });
1382
                var datesAD = $( "#accepteddate_from, #accepteddate_to" ).datepicker({
1376
                var manageddate_to = $("#manageddate_to").flatpickr({
1383
                    changeMonth: true,
1377
                    onClose: function( selectedDates, dateText, instance) {
1384
                    numberOfMonths: 1,
1378
                        validate_date( selectedDates, instance );
1385
                    onSelect: function( selectedDate ) {
1379
                    },
1386
                        var option = this.id == "accepteddate_from" ? "minDate" : "maxDate",
1380
                });
1387
                            instance = $( this ).data( "datepicker" );
1381
1388
                            date = $.datepicker.parseDate(
1382
                /* Accepted date fields */
1389
                                instance.settings.dateFormat ||
1383
                var accepteddate_from = $("#accepteddate_from").flatpickr({
1390
                                $.datepicker._defaults.dateFormat,
1384
                    onClose: function( selectedDates, dateText, instance) {
1391
                                selectedDate, instance.settings );
1385
                        validate_date( selectedDates, instance );
1392
                        datesAD.not( this ).datepicker( "option", option, date );
1386
                        accepteddate_to.set('minDate', selectedDates[0]);
1393
                    }
1387
                    }
1394
                });
1388
                });
1389
                var accepteddate_to = $("#accepteddate_to").flatpickr({
1390
                    onClose: function( selectedDates, dateText, instance) {
1391
                        validate_date( selectedDates, instance );
1392
                    },
1393
                });
1395
1394
1396
                $("button[type='submit']").on("click", function(e) {
1395
                $("button[type='submit']").on("click", function(e) {
1397
                    var submit_button = this;
1396
                    var submit_button = this;
1398
- 

Return to bug 29229