Forum

Armin Winkler
      Has successfully completed the online course Introduction
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
    2 years ago #30086
    Up
    0
    Down
    ::

    Hi Christian,

     

    if you are using the data type “Date” for input parameters, Simplifier expects a date time string following the ISO 8601 standard (as defined here) with the time zone UTC. To achieve this in combination with the DatePicker widget that you are using in your application, you need to set the value of the property “valueFormat” “to YYYY-MM-ddTHH:mm:ss.sssZ”.

    However, as your time zone might not be UTC (see the code example below for +1 hours offset for German winter time), you still need to make sure that your date time string is set to 0 UTC offset. In order to do this, you can either instantiate a new Javascript Date object and pass the value from the DatePicker as input, then invoke the function toISOString on that object (like so: new Date(“2022-01-28T00:00:00.000+0100”).toISOString()) or let momentJS handle the formatting. Whatever you prefer, simply pass the result as parameter to your BO function and the validation won’t cause a problem anymore.

    If you don’t feel like doing all these formatting steps, another alternative would be to change the date fields in your struct data type to String, then you can pass the value from the DatePicker widget to the BO without having to change it at all.

     

    Hope this helps!

     

    Regards,

    Armin