trimble-oss / modus-web-components

This library provides Modus components as web components - reusable, encapsulated UI elements that are framework agnostic (can be implemented in any site).
https://modus-web-components.trimble.com/
MIT License
31 stars 65 forks source link

Date Picker: Enable display of valid & invalid dates #2679

Open raymondboswel opened 1 week ago

raymondboswel commented 1 week ago

Prerequisites

Proposal

Add an optional input property that accepts a list of dates which will be displayed in the date picker as clickable; dates not in the passed in list are displayed as disabled. An alternate solution could be to expose an isDateEnabled function, which the user can then pass in to handle their specific logic. This is how Ionic handles the same type of functionality: https://ionicframework.com/docs/api/datetime#advanced-date-constraints

Motivation and context

We have a use case where the user has to select a date window to display machine data across. Machines however don't have data available every day; it would thus be useful to provide some visual affordance to guide the user towards picking days that actually do have data available, instead of picking dates and seeing an error message pop up.

What is the issue regarding ?

@trimble-oss/modus-web-components

Priority

Medium

What product/project are you using Modus Components for ?

WorksOS / Machine Playback

What is your team/division name ?

CCFS/Weka

Are you willing to contribute ?

Yes

Are you using Modus Web Components in production ?

No response

github-actions[bot] commented 1 week ago

Hello @raymondboswel! Thanks for opening an issue. The Modus core team will get back to you soon (usually within 24-hours) and provide guidance on how to proceed. Contributors are welcome to participate in the discussion and provide their input on how to best solve the issue, and even submit a PR if they want to.

Please wait until the issue is ready to be worked on before submitting a PR, or you can reach out to the core team if it is time bound. For trivial things, or bugs that don't change the expected behaviors and UI, you can go ahead and make a PR.