react-kronos icon indicating copy to clipboard operation
react-kronos copied to clipboard

Issue with timezones

Open eamonpenland opened this issue 8 years ago • 2 comments

Not sure why I'm having this issue. I receive a utc time as well as offset from the server. I format the time for the kronos timepicker with moment js and the timezone offset I receive from the server. Once I change the date the moment object is recreated (or cloned) and now has an est zone associated with the time stamp. I then need to convert the time to utc seconds to update the time on the server, but the conversion back does not seem to be working.

eamonpenland avatar Jun 13 '16 18:06 eamonpenland

I think I'm understanding what is happening. Would you mind providing the surrounding code so that it can be further investigated? I'm not sure what would be causing this.

felixakiragreen avatar Jun 14 '16 02:06 felixakiragreen

@dubert sure! here is a gist. https://gist.github.com/eamonpenland/cc998cf5cba1378e8b37dac5ec61f64d

this.props.changeStopTime triggers a redux action and in my reducer I have currently solved this by converting the kronos time to seconds and subtracting the time offset from est. Then I add the offset back to the time.

eamonpenland avatar Jun 14 '16 14:06 eamonpenland