angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 728 forks source link

New Event Time Problem with Timezone #360

Open mariohmol opened 8 years ago

mariohmol commented 8 years ago

Hy there!

I have a calendar and when i click in day 18/12/2015 06:00 it returns me on selectevent a date with 18/12/2015 04:00 GMT-2.

I'm at GMT-2 , but it always get me the time I clicked - 2 hours.

I tested using ignoreTImezone true or false, i set the timezone as well, but the behaviour is always the same.

    ignoreTimezone: false,
    timezone: "America/Sao_Paulo",
        select: function(start, end, allDay, jsEvent) {
            console.log(start);
            console.log( new Date(start));

If i use new Date() it shows me the correct day, hour and timezone (GMT-2). I tested using new Date(start) but it shows me the date with -2 hours as well.

artemgrygor commented 8 years ago

Same problem. Any ideas how to fix this?

martin-langhoff commented 8 years ago

Make sure you use Moment library, and its tzinfo extensions, as that's what the underlying FC understands. I had plenty of trouble until I consolidated all my datetime and tz handling on Moment.