Field-date field with restricted dates
Component Field-date
Is your feature request related to a problem? Please describe.
I would like to create a custom time range of availability, for example that a user is only able choose from 2020 to 2022 and the rest of dates were shown as unable. Or even even more specific time ranges and only allow the user to choose from a list of available dates.
Right now the users get confuses because sometimes they can choose from all dates when they know there are some restrictions.
Describe the solution you'd like
A visual restricted calendar where you can see what dates are able to choose or not and if the date is not able you can't click on it because it's disabled.
Describe alternatives you've considered
I asked in Blockly groups and the ideas are to use validators (I am trying, but the restricted dates are not shown as disabled in the calendar) and to extend the field with subclasses.
Additional context
This is another calendar I have for the users that is exactly as i want it with blockly. This one is from the Ionic library.
Thank you very much!
This is a perfectly reasonable request, but I'm not sure it's possible to fulfil given that we are planning to transition the field-date picker from the version in the Closure library to a simple <input type="date">: while the latter does support min, max and step attributes but does not have the ability to enumerate an arbitrary set of dates that can be picked.
@cpcallen so as you said it's not possible to do this kind of date selection with Blockly? I think the only way I to do it is to create an extension for the block and a custom field type isn't? It's a pity, but thank you very much.
@samYnsat :
so as you said it's not possible to do this kind of date selection with Blockly? I think the only way I to do it is to create an extension for the block and a custom field type isn't? It's a pity, but thank you very much.
Yes: you'd need to create your own FieldDate implementation (perhaps as a subclass of the existing one), and either hack up the Closure date picker or write/find a new date picker.