Set local timezone dropdown to rrule TZID value

This commit is contained in:
Marliana Lara 2018-02-15 15:13:18 -05:00
parent 73916ade45
commit e0cfd18aac
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE

View File

@ -131,8 +131,9 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
$http.get('/api/v2/schedules/zoneinfo/').then(({data}) => {
scheduler.scope.timeZones = data;
scheduler.scope.schedulerTimeZone = _.find(data, (zone) => {
return zone.name === scheduler.scope.current_timezone.name;
scheduler.scope.schedulerTimeZone = _.find(data, function(x) {
let tz = $scope.schedule_obj.rrule.match(/TZID=\s*(.*?)\s*:/)[1];
return x.name === tz;
});
});
scheduler.inject('form-container', false);