Rule for checking for past date?

  • 22 February 2017
  • 5 replies
  • 20 views

Badge +8

Is there any way to check if a user entered a past date?    I tried using the dateDiffDays function but it seems to always return a positive number regardless of the position of the arguments.

I am using Version: 2.8.1.0 of the designer.


5 replies

Badge +9

Use Compare To validation in Nintex Forms Control settings:

199749_pastedImage_1.png

Badge +8

Thanks for the quick reply.  I tend to use rules.   I think it is a bad idea to mix rules with validation but looks like I am stuck.  

But I also have to know if the date entered is no greater than 3 weeks from today.   But there is no dateAddDays function in validation!!    Any other way to do this?    I guess I can use a rule for that but would rather not.

Nintex seems to be a nice product over all but some of its quirks drive me insane.   The fact that dateDiffDays   only returns an absolute value is inexcusable.   And some functions existing in one area but not the other is simply mind numbing.

Badge +10

I think it is possible if you validate using javascript.

Badge +9

Please try following formula in rule:

lessThan(date_ctrl, Current Date) || dateDiffDays(date_ctrl, Current Date) > 21

Userlevel 6
Badge +12

Hi Bruce,

Looks like Manfred has provided a good answer.  If it's correct, could you please mark it correct so future searches come up with this answer?

You could request the dateAddDays feature (and more) via UserVoice.  I don't fancy your chances of changing dateDiff though as the new behaviour may break lots of legacy workflows.

Cheers,

Chris

Reply