How to set a deadline based on the date period set by the users?

  • RicardoMGA
    Perguntado em 4 de abril de 2024 às 15:38

    Olá,


    Gostaria de saber se é possível somar meses ou anos a partir de 2 entradas (data inicial e meses/anos a serem somados).

    por exemplo:


    How to set a deadline based on the date period set by the users? Image 1 Screenshot 20

    Nesse caso tenho o início do prazo + o prazo = vencimento. Mas dependendo do caso tenho que somar anos ou meses e esta é a minha dificuldade.


    Obrigado


  • Rose Jotform Support
    Respondido em 4 de abril de 2024 às 18:05

    Hi RicardoMGA,

    Thanks for reaching out to Jotform Support. Unfortunately, our Portuguese Support agents are busy helping other Jotform users at the moment. I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in Portuguese, let us know and we can have them do that. But, keep in mind that you'd have to wait until they're available again.

    I am currently working on your inquiry and need more time. I will get back to you shortly.

    Let us know if there’s anything else we can help you with. 

  • Rose Jotform Support
    Respondido em 4 de abril de 2024 às 18:35

    Hi RicardoMGA,

    Thanks for waiting. To set the deadline expiration date based on the user's terms set up on your form in the screenshot above, you can do the steps below:

    How to set a deadline based on the date period set by the users? Image 1 Screenshot 50

    • Add a Form Calculation widget to your form to calculate the total number of days based on the value in the "Terms" field and the "Units" field.

    How to set a deadline based on the date period set by the users? Image 2 Screenshot 61

    • Add an Update/Calculate conditional logic to add the total number of days to the deadline start and insert the result to the deadline expiration. Here's the condition to add based on your form set up:

    How to set a deadline based on the date period set by the users? Image 3 Screenshot 72

    Here's the output:

    How to set a deadline based on the date period set by the users? Image 4 Screenshot 83

    You can also clone my demo form. Here's the guide on How to Clone an Existing Form From a URL.

    Give it a try and let us know if you need any help.

  • RicardoMGA
    Respondido em 5 de abril de 2024 às 08:49

    Olá Rose,

    Eu tinha feito este procedimento que você me mostrou só que usando as condições nas configurações do formulário, mas, em relação aos meses, o problema ocorre quando são dois meses com 31 dias seguidos ou no caso de fevereiro que tem menos dias e em relação aos anos também ocorre erro quando o ano é bissexto, ou seja, a data final fica errada em todos esses casos citados.


    Obrigado.

  • Rose Jotform Support
    Respondido em 5 de abril de 2024 às 09:50

    Hi RicardoMGA,

    Thanks for getting back to us. Unfortunately, that's the closest simplest workaround to achieving your goal. This is why the monthly value was set to 30.5 for the months with 30 or 31 days. If you need to capture the actual number of days based on the month or year, it would take a huge number of calculation fields and conditions to add to your form.

    Let us know if there’s anything else we can help you with.