Release Automation

 View Only
  • 1.  Date and time validation

    Posted Jul 30, 2018 07:03 PM

    I need to enter a date and time in a process. 
    I verify that the entered text in the "user input" action is a date/time greater than today/now, I use "Compare Two Dates" action, but I cannot verify that the number of day or month is valid or that the hour and minutes entered are a valid time. So,  the user can enter something like "32/14/2018 25:68" (format is dd/MM/yyyy HH:mm) and the comparison with the current date and time works anyway with no error.


    The only option I have for enter a date/time is a user input action?
    Is there another type of action to enter date and time with a calendar or something like that?
    Are there actions to verify that the text is a valid date/time ?.


    process run view

  • 2.  Re: Date and time validation
    Best Answer

    Broadcom Employee
    Posted Jul 31, 2018 08:54 AM



    I'm not sure I understand the purpose of the user input (scheduling?). But if you have to have the user input for the user to enter a day and time than three possible options you could look at include:

    1. The javascript action. You could probably convert the user input value to a date object and then do the comparison.

    2. The Run Command Line action (to run on linux) to do the conversion and comparison.

    3. Powershell action to do the conversion and comparison. 


    If you are bound to the user input to get a date and time then I would recommend you use another action to confirm that the format is what you were expecting and that the values are valid. For example, a value of 13 for the month wouldn't be valid and, if you're lucky, would fail in later conversions.


    Kind regards,