angular-ui / ui-calendar

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

Display UTC as Local #426

Open jamesh38 opened 8 years ago

jamesh38 commented 8 years ago

So I'm confused as to what I'm doing wrong here.

I want to store the events start and end in UTC in the databse. Then I want to display them on the fullcalendar ui as local.

I tried setting

$scope.uiConfig = {
    calendar: {
        timezone: 'local'
    }
}

But it doesn't seem to be doing anything. Am I misunderstanding?

jumois commented 7 years ago

I was fighting with this too. For me, the timezone property resets to false after setting my event source. Or maybe it is not actually working at all from the config directive?

I got it working by setting it directly using the FullCalendar: angular.element('.calendar').fullCalendar('option', 'timezone', 'local');

Related issue: https://github.com/angular-ui/ui-calendar/issues/385