Describe the bug
When displayDateMin or displayDateMax are set via calendar.set() and later updated with undefined, the calendar keeps the previous constraints. Disabled dates remain disabled instead of reverting to the default range.
This makes it hard to dynamically clear min/max limits in reactive UIs (e.g. when a filter preset is cleared).
Steps to reproduce
<script type="module">
import { Calendar } from 'vanilla-calendar-pro';
const input = document.getElementById('date-input');
const calendar = new Calendar(input, { inputMode: true });
calendar.init();
calendar.set({
displayDateMin: '2026-06-01',
displayDateMax: '2026-06-30',
});
// Later: try to clear limits
calendar.set({
displayDateMin: undefined,
displayDateMax: undefined,
});
</script>
<input id="date-input" />
Expected behavior
Passing undefined for displayDateMin / displayDateMax should reset them to the library defaults (same as on first init), and dates outside the previous range should become selectable again.
CodeSandbox example (REQUIRED)
https://codesandbox.io/p/sandbox/5xq5sf
- Click 1. Set range (Jun 2026) → open calendar → only June dates are enabled.
- Click 2. Clear with undefined → open calendar → dates outside June are still disabled (bug).
- Click 3. Clear with defaults → open calendar → all dates are enabled (workaround).
Additional context
As current workaround - explicitly pass the default boundary strings instead of undefined:
calendar.set({
displayDateMin: minDate ? formatDate(minDate) : '1970-01-01',
displayDateMax: maxDate ? formatDate(maxDate) : '2470-12-31',
});
(These match the internal defaults we found in the source: dateMin / dateMax default to '1970-01-01' and '2470-12-31'.)
Describe the bug
When
displayDateMinordisplayDateMaxare set viacalendar.set()and later updated withundefined, the calendar keeps the previous constraints. Disabled dates remain disabled instead of reverting to the default range.This makes it hard to dynamically clear min/max limits in reactive UIs (e.g. when a filter preset is cleared).
Steps to reproduce
Expected behavior
Passing undefined for displayDateMin / displayDateMax should reset them to the library defaults (same as on first init), and dates outside the previous range should become selectable again.
CodeSandbox example (REQUIRED)
https://codesandbox.io/p/sandbox/5xq5sf
Additional context
As current workaround - explicitly pass the default boundary strings instead of undefined:
(These match the internal defaults we found in the source: dateMin / dateMax default to '1970-01-01' and '2470-12-31'.)