Using Javascript to change a Date Field for country specific export



  • Rainer Grabowski (FVM)

    Hi Lee,

    it's not a coding issue, it's a logical issue :)

    The date 31.03. in your date field is AFTER DST-change on 29th. The calculation with moment () always takes the current time at the moment you create that field (or the moment one of the values in the formula changes). Change the date in the date field to 28.03. and you'll see that the time in the calculation field will also be 11:00.

    To avoid this DST-issue set the time zone in your calculation:

    moment(@Appointment Date).tz('Europe/London').format("dddd MMM Do YYYY a")


    Comment actions Permalink
  • Lee Standell

    You are a good man Rainer, Thank you very much :)

    Comment actions Permalink
  • Patrik Näsfors

    Thanks a lot!

    It solved a problem for me too with all day events, where I am calculating the date to use in the title. When the start date field was set to 14-05-2017 00:00, the date was calculated to 13-05-2017.

    But with the help of the tz time zone function, it solved this problem. So the calculation I'm using now is this:


    Best regards,

    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk