238
Views
5
Comments
Solved
Enable list of input dates only
Question
Application Type
Reactive

I have one scenario that i need to diplay a list of dates only in date picker which are coming as Input parameters and disable other dates so that user can select only specific date from date picker. Can someone tell me the solution how to show list of specific dates on date picker.

UserImage.jpg
Dhineshkumar K
Solution

Hi Shahrukh,

If you have the list of dates list to be enabled follow the below steps,


1. Set MinDate to the lowest date of the list

2. Set MaxDate to the Highest date of the list

3. Create a list with the name of Alldates(Date data type) and AllDateTimes(Date Time Data type)

4.  Append all the dates from lowest date to highest date in Alldates.

5. Run a for loop for Alldates use listindexoff to find the available dates from the original list like the below screenshot.

6. Set the Disabledayslist of datepicker to AllDateTimes like the below screenshot.

Hope this will help you to resolve the problem.

Regards,

Dhineshkumar k

UserImage.jpg
Shahrukh Barmaky

Hi Dhineshkumar,

Thank you for the solution. It is working as expected. 

2023-12-14 09-56-57
Yogesh Javir

Hey,
If you want to show date from input to date picker then inside variable property of date picker you can assign input variable to date picker.

If you want to restrict user to select date between specific date then you have to provide min and max date to date picker so date picker will only show date which you want to show and rest date will be disable or unclickable .

Hope you will get it.

Thanks

Yogesh

2024-07-09 07-02-02
Mukul Singh Nathawat

Hi Shahrukh Barmaky,

Good day to you.

you can achive it by Passing Min and max in the attribute property of the input variable.

In this the mindate is the local variable binded to the min date input field and the max date is the local variable binded to the max date input field.

hope this help.

mukul singh nathawat

UserImage.jpg
Shahrukh Barmaky

Selecting range (Min and Max) and then getting the list of date are not the requirement.

List of available slot date already coming from API, I have to show those date only as enabled on date picker.

For example: From API getting 3 dates (09-06-2022, 12-06-2022, 16-06-2022) as available date slot. Need to enable only these 3 date on date picker and rest others date should be greyed out.

UserImage.jpg
Dhineshkumar K
Solution

Hi Shahrukh,

If you have the list of dates list to be enabled follow the below steps,


1. Set MinDate to the lowest date of the list

2. Set MaxDate to the Highest date of the list

3. Create a list with the name of Alldates(Date data type) and AllDateTimes(Date Time Data type)

4.  Append all the dates from lowest date to highest date in Alldates.

5. Run a for loop for Alldates use listindexoff to find the available dates from the original list like the below screenshot.

6. Set the Disabledayslist of datepicker to AllDateTimes like the below screenshot.

Hope this will help you to resolve the problem.

Regards,

Dhineshkumar k

UserImage.jpg
Shahrukh Barmaky

Hi Dhineshkumar,

Thank you for the solution. It is working as expected. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.