cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Comparing Dates Validation

Jump to solution

Hi all,

I am having trouble with using Validation for the Datepicker (w/ time) in Nintex Form. Basically, I want something like enddate > startdate.

If I use greaterthan rule, it always returns true.

Also happens when I try to use the diffDays, always returns true.

If I try to use custom javascript to get the datepicker, it only gets the date and not the time (ex. 9/10/2015 instead of 9/10/2015 10:00:00).

Has anyone done anything similar? Can you please share what you did? Or maybe I'm doing something wrong?

Thank you!

Labels: (3)
0 Kudos
Reply
10 Replies
Highlighted
Nintex Newbie

Re: Comparing Dates Validation

Jump to solution

Hi Lean

the following formula worked for me (Nintex Forms 2013) for two date/time controls named 'to' and 'from'. The rule is associated to control 'to':

Kind regards

Manfred

View solution in original post

Reply
Highlighted
Not applicable

Re: Comparing Dates Validation

Jump to solution

Thanks Manfred!

I have tried that but it doesn't return 'false' anymore. Just continues being invalid.

0 Kudos
Reply
Highlighted
Not applicable

Re: Comparing Dates Validation

Jump to solution

Okay, I found out what is wrong. I was using Item Properties instead of Named Controls

Thanks Manfred!

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Comparing Dates Validation

Jump to solution

Here is a great post on date validation as well, for anyone interested: How to complete Date Validation using Nintex Forms 2013 Validation Rules.

If someone has answered your question, please mark their response as correct so others know the issue is resolved.

Thanks!

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Comparing Dates Validation

Jump to solution

Hello,

 

I created two date controls named as Start Date and End Date. I then applied a validation rule to End Date Control to throw an error if Start Date > End Date. When I previewed the form I was able to enter Start Date as10/22/2019 and End Date as10/21/2019. Therefore, the validation rule is not working in my case since I am able to enter the Start Date > End Date. I am using greaterThan() runtime function. Please check the attached screenshots. 

 

Do I need to do anything to the date control or the formula? Or do I need to use a different runtime function?

 

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: Comparing Dates Validation

Jump to solution

@RAHULGANDHI The formula is correct.

One thing I did notice is the comma between start and end date is red.

I would try re-creating the formula again.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Comparing Dates Validation

Jump to solution
Thanks for response! It always come as red. I don’t know why. I am doubleClicking and inserting dynamicNamed control- start date then when I type comma it appears red for some reason. What might the reason behind this red comma?
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Comparing Dates Validation

Jump to solution
Can you create a simple form and share with me? May be something I am doing is wrong
0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: Comparing Dates Validation

Jump to solution

Hi,

Sample Classic form attached.

 

NotValid.png

0 Kudos
Reply