Forum Academy Marketplace Showcase Pricing Features

Saving a due date by weeks

I’m creating an input where people can select how often they do a reoccurring task, i.e.:
every 3 days
every 4 weeks
every 2 months

Because you can only add days, months, or years to your current date/time, I’m finding it difficult to add weeks. I’ve tried adding the input value * 7 days, but there isn’t a way I can find to multiply the input value by 7.

Any implementation that works is fine with me, please let me know if you have any solutions/ideas. Thank you!

You will have to do the math before that point. You can save data to the page itself, which is where we are going to be temporarily storing the total amount of days.

To do this, make it so after the user clicks “Save” or whatever your button is called, it sets a value to the page, which would be that input * 7.

You should find this in the actions menu under Element Action, then Set State, the element would be your page. Create a custom state, like I did, then do the math, which will save that number to the page itself.

Then make your due date just use the page’s number.

Let me know if you run into any issues.

3 Likes

Works like a charm, thank you!

1 Like

You are welcome, glad it helped you!