Release Automation

  • 1.  Date.Parse in action Execute JavaScript code

    Posted Apr 21, 2016 07:08 AM

    We are trying to excute this code in action "Execute JavaScript Code":

    Date.parse("2015.06.29")

     

    But the result is:

    Script execution succeeded. Result: Output String: NaN

     

    What is it wrong?



  • 2.  Re: Date.Parse in action Execute JavaScript code

    Posted Apr 21, 2016 01:01 PM

    NaN is an error code meaning "Not A Number" -- or a number we can't parse/display.

     

    Date.Parse() returns the number of milliseconds since 1/1/1970.

     

    So in your JavaScript action, make sure and set the output:

     

    output1 = Date.parse(...)

     

    Also, i'm not sure that date is in a valid format.....check this page:  https://msdn.microsoft.com/en-us/library/ff743760(v=vs.94).aspx



  • 3.  Re: Date.Parse in action Execute JavaScript code

    Posted Apr 22, 2016 02:58 AM

    We set:

     

    and

     

    But the result is the same NaN.



  • 4.  Re: Date.Parse in action Execute JavaScript code
    Best Answer

    Broadcom Employee
    Posted Apr 22, 2016 05:03 AM

    Hi,

     

    You can see Results are String type on [Outputs] tab of action definition.

    001.jpg

     

    Date.parse is not string but number type. So, we need to convert to string. I tried to use String().

    002.jpg

     

    And then, result value can be gotten.

    003.jpg

     

    I hope this steps help you.

    Thanks

    Yas



  • 5.  Re: Date.Parse in action Execute JavaScript code

    Posted May 05, 2016 02:51 PM

    Hi Maricarmen,

     

    Did Yasuyuki_Miura's latest comment help you to resolve your issue? If so, please be sure to mark it as correct.

     

    Thanks!

    Melanie