fix(calendar): convert event times to local timezone on parse
This commit is contained in:
@@ -28,9 +28,9 @@ class CalendarEvent {
|
||||
factory CalendarEvent.fromJson(Map<String, dynamic> json) => CalendarEvent(
|
||||
id: json['id'] as int,
|
||||
title: json['title'] as String? ?? '',
|
||||
startDt: DateTime.parse(json['start_dt'] as String),
|
||||
startDt: DateTime.parse(json['start_dt'] as String).toLocal(),
|
||||
endDt: json['end_dt'] != null
|
||||
? DateTime.parse(json['end_dt'] as String)
|
||||
? DateTime.parse(json['end_dt'] as String).toLocal()
|
||||
: null,
|
||||
allDay: json['all_day'] as bool? ?? false,
|
||||
description: json['description'] as String? ?? '',
|
||||
|
||||
Reference in New Issue
Block a user