188
Views
6
Comments
Solved
Disable only Specific Range of dates in Datepicker
Application Type
Mobile, Reactive
Service Studio Version
11.54.1 (Build 62118)

Hey Folks! I need to Disable the range of dates in our date picker. Ex. The date is from 16 to 23, which should be disabled, and after the 23rd the user can select the date from the date picker. It should be done in one date picker, not between two date pickers. Please find the image I shared with it

Note: the date 16 is retrieved from the database and 23 is the current date.

2023-04-16 15-25-31
Krishnanand Pathak
Solution

Hi Chiranjeevi,

You can use the client action provided DatePickerDisableDays refer the below image.
It is used to Set a list of specific days unavailable for selection on the DatePicker.

 

Regards
Krishnanand Pathak

UserImage.jpg
Chiranjeevi Balaji

Hey @Krishnanand Pathak 

I already use this one.. but it's not working correctly. Can you please share any oml regarding this? it'll better to understanding...

and Where we can use the date picker disable days action?

Is there any js script to restrict or disable those days?

2023-04-16 15-25-31
Krishnanand Pathak

you can use the DatePickerDisableDays action in datepicker Initialized handler



Oml is also attached for reference

DatePicker.oml
2023-04-16 15-25-31
Krishnanand Pathak
Solution

Hi @Chiranjeevi B,
Sharing the updated oml.
In which we string of date in the format(ie. 2023-03-26, 2023-03-28, 2023-03-29).
I have used string split on "," assign the output list in ListOfDisbleDays variable of(Date List type).
Then passed ListOfDisbleDays in the DatePikerDisableDays. As shown below


Please check and let me know.

Regards
Krishnanand Pathak

DisableDays.oml
2023-04-16 15-25-31
Krishnanand Pathak
Solution

Hi Chiranjeevi,

You can use the client action provided DatePickerDisableDays refer the below image.
It is used to Set a list of specific days unavailable for selection on the DatePicker.

 

Regards
Krishnanand Pathak

UserImage.jpg
Chiranjeevi Balaji

Hey @Krishnanand Pathak 

I already use this one.. but it's not working correctly. Can you please share any oml regarding this? it'll better to understanding...

and Where we can use the date picker disable days action?

Is there any js script to restrict or disable those days?

2023-04-16 15-25-31
Krishnanand Pathak

you can use the DatePickerDisableDays action in datepicker Initialized handler



Oml is also attached for reference

DatePicker.oml
2023-04-16 15-25-31
Krishnanand Pathak

Hi @Chiranjeevi B,

Is the above solution worked ?

If yes then mark it as solution so that it will helpful for others also.

Regards
Krishnanand Pathak

UserImage.jpg
Chiranjeevi Balaji

Hi Krishnanand,

Sorry for the late reply... I saw your oml which you shared. In that oml, you define the dates like this

That DisabledDays property asking for a list of dates. But I have the list of dates in this format (ie. 2023-04-23, 2023-03-24, 2023-04-25) and got this format with help of string join action (it returns in text format).

So, my query is how can I pass this format into the DisabledDays property to disable the specific list of dates?

2023-04-16 15-25-31
Krishnanand Pathak
Solution

Hi @Chiranjeevi B,
Sharing the updated oml.
In which we string of date in the format(ie. 2023-03-26, 2023-03-28, 2023-03-29).
I have used string split on "," assign the output list in ListOfDisbleDays variable of(Date List type).
Then passed ListOfDisbleDays in the DatePikerDisableDays. As shown below


Please check and let me know.

Regards
Krishnanand Pathak

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