Skip to content

feat(DateField): refDate option to open the calendar on a given month - #1373

Merged
mstijak merged 1 commit into
masterfrom
feat/datefield-ref-date
Nov 24, 2026
Merged

mstijak merged 1 commit into
masterfrom
feat/datefield-ref-date

Conversation

@mstijak

@mstijak mstijak commented Nov 24, 2026

Copy link
Copy Markdown
Member

DateField and DateTimeField accept refDate, which is passed to the calendar picker: if no date is selected, the calendar opens on the month of this date instead of the current month, e.g. if the current month cannot be selected.

Fixes #549.

Implementation

Calendar already supports refDate. DateTimeField now declares it and passes it to the picker together with value, minValue and the other picker props, so it can be bound. The field normalized a refDate in prepareData, but it was not a data property of the field, so that line had no effect and is removed.

Docs

refDate is added to the configuration of DateField and DateTimeField.

Tests

New DateField.browser.spec.tsx:

  • opens the calendar on the month of refDate if no date is selected (DateField ref date #549), which fails without the change;
  • opens the calendar on the month of the selected date, also with refDate;
  • opens the calendar on the current month without refDate.

DateField and DateTimeField accept refDate, which is passed to the calendar picker: if no date is selected, the calendar opens on the month of this date instead of the current month, e.g. if the current month cannot be selected.

Fixes #549.
@mstijak
mstijak merged commit 2693cd3 into master Nov 24, 2026
2 checks passed
@mstijak
mstijak deleted the feat/datefield-ref-date branch November 24, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DateField ref date

1 participant