justinmind-logo
 
Upvote 1

How add formula in date

Answered Viswanathan Murali 5 years ago

Hi,

Please help me to get add formula in date.


Example - I want tomorrow date formula is (Today +1)

Replies (1)
photo
2

Hi there,

This is a little complicated, because natively we don’t have this functionality. However, you can do it manually using events and expressions.

To start, you need to split the current date into month, day and year using the substring method in expressions and save these values into variables.

Then, you need to add one day to the “day” variable using a set value event, and then check if the resulting value is still valid as a date (we don’t want a 32-day month!).

If it is the case, you need to set up another set value event to set the day to “1” and add 1 to the month value. And do the same for years.

At last, once the calculations are done, you need to add a final set value event to concatenate all variables into a date format (MM/DD/YYYY).

Hope this helps.

Best,

Danielle

photo
1

HI,

Thanks for your response, please share any sample prototype which you mention above.!

photo
1

We don't have an example for this specific type of prototype, but you might find it helpful to look at another prototype tutorial where you use the substring method: https://www.justinmind.com/support/how-to-change-the-quantity-format-in-your-interactive-prototypes/

photo
Leave a Comment
 
Attach a file