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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (-3 / +9 lines)
Lines 159-166 Link Here
159
            let fp = $(this).flatpickr(options);
159
            let fp = $(this).flatpickr(options);
160
            if ( refresh_max_date ) {
160
            if ( refresh_max_date ) {
161
                /* Refresh the maxDate every 30 secondes to make sure the user will not
161
                /* Refresh the maxDate every 30 secondes to make sure the user will not
162
                   be stuck with the minute passed */
162
                   be stuck with the minute passed.
163
                setInterval(() => { fp.set("maxDate", new Date()) }, 30000);
163
                   Adding 1 minute to not introduce a gap.
164
                   Example: last update at 40s, a new minute passed at 00.
165
                   Between 00 and 10s the user won't be able click 'Today'.
166
                */
167
                setInterval(() => {
168
                    let now = new Date();
169
                    fp.set("maxDate", now.setMinutes(now.getMinutes() + 1));
170
                }, 30000);
164
            }
171
            }
165
        });
172
        });
166
    });
173
    });
167
- 

Return to bug 29478