cancel
Showing results for 
Search instead for 
Did you mean: 

How to check for past date in a datepicker ?

Former Member
0 Kudos

Hello All,

Does anyone knows how to check if the chosen date from a datepicker is in the past ? Currently, there is only an onEnter property in the input field which is mapped to a context attribute having the data type DATE. Unfortunately, there is no "OnChanged/OnSelect" property which will be useful to trigger some validation method.

My validation method will only be triggered should a user hits the Enter key but not after a selection is made from the datepicker.

Any help will be appreciated. Thank you.

from

Kwok Wei

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185029
Active Contributor
0 Kudos

Hi Kwok,

for your purpose why not use DateNavigator component? It has events like onDateSelect or onMonthSelect where you can specify your validation.

Ashutosh

Former Member
0 Kudos

Hello Ashutosh

I have definitely considered that but so far I am not able to 'hide' the date navigator unlike the way the input field does. Do let me know if you have a way to minimise the datanavogator

from

Kwok Wei

former_member185029
Active Contributor
0 Kudos

Hi Kwok,

there are many way to achive that.

One that quickly comes to my mind is that you can hide the visibility of datepicker, then you can manage the visibility on click of any button. Then hide it on date select event.

Ashutosh

Former Member
0 Kudos

hmmm... that is a very interesting idea... however i do have some space constrains issue to consider. Let me go play around with the idea and do let me know if you can have a more eleganat solution to this. I will award points should there be no more further ideas contributed . Thanks !!