Repository navigation
feat: add per-date factory for date metadata provider - #9884
Merged
Merged
Conversation
For rules that can answer from memory, iterating the range and collecting
entries by hand is boilerplate. DateMetadataProvider.perDate(...) takes a
function from a date to its metadata, or null for none, and handles the
iteration:
datePicker.setDateMetadataProvider(DateMetadataProvider.perDate(
date -> isFullyBooked(date) ? new DateMetadata(date, true)
: null));
The function runs once per date in the requested range, so its Javadoc
points backend-backed rules at implementing the provider directly, where
a single query answers for the whole range.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
web-padawan
marked this pull request as ready for review
August 14, 2026 12:48
vaadin-review-bot
left a comment
Collaborator
There was a problem hiding this comment.
✅ Nothing to flag — the changes look good.
|
1 of 2 tasks
vursen
approved these changes
Aug 14, 2026
Collaborator
|
This ticket/PR has been released with Vaadin 25.3.0-alpha9. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



DateMetadataProvideris called with a range of dates, so a rule that only looks at one date at a time has to iterate the range and collect the entries by hand:For rules that answer from memory, that is boilerplate. The new factory takes a function from a date to its metadata, or
nullfor a date that has none:Changes
The factory is a static method on
DateMetadataProvider, not a new setter on the components.setDateMetadataProviderstays the only entry point,getDateMetadataProvider()keeps a single answer, and nothing has to be mirrored on Date Time Picker later.The function runs once per date in the requested range, which can cover up to a year. The Javadoc says it has to answer from memory, and points rules that query a backend at implementing the provider directly, where a single query can answer for the whole range. Making the per-date shape look this convenient is exactly how a query-per-date ends up in an application, so the warning sits on the factory itself.
Part of vaadin/platform#2867
🤖 Generated with Claude Code