Hello,
I am looking for the formula for date picker, that only accepts dates from current and next month, therefore I have applied following formula, however it's not working as expected - Can any one please suggest What am I missing??
DatePicker OnSelect/OnChange
If(Month(DataCardValue9.SelectedDate) <> Month(Today())+1 Or Month(DataCardValue9.SelectedDate) <> Month(Today()),Set(ErrMessage,"Invalid Date"),Set(ErrMessage,""))
Label.Text = ErrMessage
Can you please share correct formula?
Thanks,
Solved! Go to Solution.
Hi @PowerApper25 ,
Very strange, should work but does not - however this does
If(
Month(DataCardValue9.SelectedDate)
=
Month(Today())+1
||
Month(DataCardValue9.SelectedDate)
=
Month(Today())
,
Set(ErrMessage,"")
,
Set(ErrMessage,"Invalid Date")
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @PowerApper25 ,
Try the below - I parsed it for easy reference of the logic.
If(
Month(DataCardValue9.SelectedDate)
<>
Month(Today())+1
||
Month(DataCardValue9.SelectedDate)
<>
Month(Today())
,
Set(ErrMessage,"Invalid Date")
,
Set(ErrMessage,"")
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up..
Hi WarrenBelz,
Thank you for your suggestion, however it still behaves the same, Error message is not disappearing if condition is right, Does this formula work for you?
Best Regards,
Hi @PowerApper25 ,
Very strange, should work but does not - however this does
If(
Month(DataCardValue9.SelectedDate)
=
Month(Today())+1
||
Month(DataCardValue9.SelectedDate)
=
Month(Today())
,
Set(ErrMessage,"")
,
Set(ErrMessage,"Invalid Date")
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
User | Count |
---|---|
204 | |
93 | |
84 | |
47 | |
42 |
User | Count |
---|---|
251 | |
104 | |
104 | |
62 | |
57 |