Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
Local Time for igDateTimeEditor and ignite ui generally.
posted

Hello,
we currently use the igDateTimeEditor to offer the user to write her local time into the editor.
Now our problems are:
We want the user to be able to select her UTC time offset via dropdown somewhere locally on the website. This will be stored locally and on the server.

Now:
How can we make ignite ui add the user defined UTC time offset, when receiving time from the server (so it becomes local time)?
And, how can we make ignite ui substract the user defined UTC time offset, when posting time to the server (so it becomes UTC time again)?
We want the server to only send, receive and handle UTC time which will then be converted into local time on the client side.

Thank you in advance!

Parents
No Data
Reply
  • 2671
    Offline posted

    Hello,

     

    I don’t see any information for platform and with no way of knowing how the data is delivered and sent back I can only provide general advice.

    JavaScript Date objects on the client are always in the client’s system time by default. We do offer the enableUTCDates option to show UTC, but other variations are not available. You could initialize the Date object as UTC or any other time zone to tweak the values and you should be able to the UTC string from the JavaScript object to send back to the server.

    Quick example you can tweak around with (uncomment some of the variations):

    http://jsfiddle.net/damyanpetev/aL2nfxbz/

    I might be able to provide further help if you can provide a bit more details about the use case.

     

    Regards,

    Damyan Petev

    Associate Software Developer

    Infragistics, Inc.

Children
No Data