Original post:
Dear All,
I hope you are doing okay?
Please, I need some help with dates on an event program.
I am trying to create a validation on a date field to ensure that only dates entered within a specified period are allowed in that field e.g. ART start date must be between October 1, 2017 and September 30, 2018.
How do I create this using a Program rule?
I have tried things like:
V{dt_art_st}>=‘2017-10-01’ && V{dt_art_st}<=‘2018-09-30’
and
#{dt_art_st}>=‘2017-10-01’ && #{dt_art_st}<=‘2018-09-30’
and
#{dt_art_st}>=(“2017-10-01”) && #{dt_art_st}<=(“2018-09-30”)
Not sure what to do or how to proceed with this.
Thank you for your help
Hello All,
Been struggling a bit to get a date validation rule to work in tracker.
The post is above.
When this was not working the way I wanted, I tried to setup a check to see if the rule was working well using the d2:daysBetween function as per guidance (see below)
Here is the rule I wrote:
d2:daysBetween(#{dt_art_st}, ‘2018-09-30’)
This was the result:
On a hunch, I changed the date format from YYYY-MM-dd in the guidance to dd-MM-YYYY (as seen below):
d2:daysBetween(#{dt_art_st}, ‘30-09-2018’)
Cleared cache and tried again and this was the result
So, I am not sure whether this is an issue with the system or an issue with the documentation. However, even with these changes, the validation rule is still NOT working and does not recognize dates within the specified period.
Not sure what to do next with this.
Thanks for your help.