Adding days onto a date field based on a picklist.

Comments

7 comments

  • Official comment
    Avatar
    Tony Ruth

    Hey Karl, please have a look at the package attached to the bottom of this article and let me know what you think. It uses page level JavaScript and I modified the pick list a bit from my previous comment.
    https://iformbuilder.zendesk.com/hc/en-us/articles/201697670
    Hope it helps!

    Comment actions Permalink
  • Avatar
    Tony Ruth

    Hi Karl, have a look at this article below and see if it helps.

    https://iformbuilder.zendesk.com/hc/en-us/articles/201697670-How-do-I-dynamically-set-a-date-

    0
    Comment actions Permalink
  • Avatar
    Karl Simms

    Thanks again for the response tony,

    That is kind of what im looking for, is there anyway to implement the amount of days that are added , if the pick list was to change,

    The reason for this is because we have 6 items in this picklist,
    4 of them are the start date + 54 weeks, 2 of them are the Start date + 60 weeks.

    How do i get the picklist item into that calculation?
    IE if i select level 3 on the pick list it adds 54 weeks on to the start date, but if that is changed to level 4 it adds 60 weeks onto the start date.

    Sorry tony, javascript unfortunately is not one of my strong points.
    i do really appreciate your help.

    0
    Comment actions Permalink
  • Avatar
    Tony Ruth

    Hey Karl, one thing you could do is leverage the key_value of the items in the list to help influence the start time. What I mean is that if you have 6 options, they would look something like this.

    Label => Key Value
    Option1 => option1_54
    Option2 => option2_54
    Option3 => option3_54
    Option4 => option4_54
    Option5 => option5_60
    Option6 => option6_60

    This along with ZCDisplayKey function would let you dynamically add the number of start days to the function (please see below). You would need to parse out only the part you care about which comes after the underscore.

    https://iformbuilder.zendesk.com/hc/en-us/articles/201698690?

    Hope that helps!

    1
    Comment actions Permalink
  • Avatar
    Karl Simms

    Hi tony,

    Not had chance to try this yet., but thank you.

    0
    Comment actions Permalink
  • Avatar
    Karl Simms

    that actually works a treat and is exactly what im looking for, just need to get it working in bluestacks lol.

    Thank you very much tony.... again

    0
    Comment actions Permalink
  • Avatar
    Karl Simms

    Hi tony sorry , do you know if theres a alternative way to get this to work on andriod?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk