Merge pull request 'fix(calendar): convert event times to local timezone on parse' (#15) from dev into main
This commit was merged in pull request #15.
This commit is contained in:
@@ -28,9 +28,9 @@ class CalendarEvent {
|
|||||||
factory CalendarEvent.fromJson(Map<String, dynamic> json) => CalendarEvent(
|
factory CalendarEvent.fromJson(Map<String, dynamic> json) => CalendarEvent(
|
||||||
id: json['id'] as int,
|
id: json['id'] as int,
|
||||||
title: json['title'] as String? ?? '',
|
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
|
endDt: json['end_dt'] != null
|
||||||
? DateTime.parse(json['end_dt'] as String)
|
? DateTime.parse(json['end_dt'] as String).toLocal()
|
||||||
: null,
|
: null,
|
||||||
allDay: json['all_day'] as bool? ?? false,
|
allDay: json['all_day'] as bool? ?? false,
|
||||||
description: json['description'] as String? ?? '',
|
description: json['description'] as String? ?? '',
|
||||||
|
|||||||
Reference in New Issue
Block a user