Question

How to Get Previous Year date in SmartForms

  • 24 September 2020
  • 2 replies
  • 46 views

Hello Mates,

I had date control and when user select any date like *personal details removed* i would like to display the previous year date in another date control so date should be *personal details removed*. How we can do this. I had created expression but due to time zone issues its not working.

 

Can you let me know how to handle this.


2 replies

Userlevel 2
Badge +4

Hi  @Tan 

 

 

 

 

I dont know fully understand the question, But I was able to do so by using Transfer action rule when Calender/date control was changed.

 

The rule
rule to just transfer date from one control to the other

 

 

If you want to subtract a year from the given date, You can use the substract days function in your expression (Have a look at the attachments), Be aware that this doesn't work everytime since there are Leap years.

Expression
Rule with expression

 

Final results

 

 

I hope this helps, but If doesn't, would you maybe give me more details on this.

 

 

 

Regards

 

HulisaniN

 

Badge +4

As HulisaniN mentioned,  just add checking whether it’s a leap year or non-leap year.

 

number of day in leap year is 366 and number of day in non-leap year is 365

 

Reply