Skip to content

Commit 2ba4222

Browse files
v0.10.1 (#61)
1 parent 5a756a3 commit 2ba4222

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.10.1
2+
* **Fixed DateTime UTC handling** in `createEvent()`, `createEventInDefaultCalendar()` and `retrieveEvents()` by systemically calling `dateTime.toUtc()`
3+
14
## 0.10.0
25
* **Changed signature of createEventInDefaultCalendar** to not return the created event as the event will not be editable
36

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Eventide provides a easy-to-use flutter interface to access & modify native devi
3737
:white_check_mark: | Attendees
3838
:construction: | Streams
3939

40-
> **Note:** Eventide handles timezones as UTC. Make sure the right data is feed to the plugin with a [timezone aware DateTime class](https://pub.dev/packages/timezone).
40+
> **Note:** Eventide handles timezones as UTC. Make sure the right data is fed to the plugin with a [timezone aware DateTime class](https://pub.dev/packages/timezone).
4141
4242
---
4343

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ packages:
7979
path: ".."
8080
relative: true
8181
source: path
82-
version: "0.10.0"
82+
version: "0.10.1"
8383
fake_async:
8484
dependency: transitive
8585
description:

lib/src/eventide.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class Eventide extends EventidePlatform {
120120
final event = await _calendarApi.createEvent(
121121
calendarId: calendarId,
122122
title: title,
123-
startDate: startDate.millisecondsSinceEpoch,
124-
endDate: endDate.millisecondsSinceEpoch,
123+
startDate: startDate.toUtc().millisecondsSinceEpoch,
124+
endDate: endDate.toUtc().millisecondsSinceEpoch,
125125
isAllDay: isAllDay,
126126
description: description,
127127
url: url,
@@ -162,8 +162,8 @@ class Eventide extends EventidePlatform {
162162
try {
163163
await _calendarApi.createEventInDefaultCalendar(
164164
title: title,
165-
startDate: startDate.millisecondsSinceEpoch,
166-
endDate: endDate.millisecondsSinceEpoch,
165+
startDate: startDate.toUtc().millisecondsSinceEpoch,
166+
endDate: endDate.toUtc().millisecondsSinceEpoch,
167167
isAllDay: isAllDay,
168168
description: description,
169169
url: url,
@@ -191,8 +191,8 @@ class Eventide extends EventidePlatform {
191191
DateTime? endDate,
192192
}) async {
193193
try {
194-
final start = startDate ?? DateTime.now().add(const Duration(days: -3));
195-
final end = endDate ?? DateTime.now().add(const Duration(days: 7));
194+
final start = (startDate ?? DateTime.now()).toUtc().add(const Duration(days: -3));
195+
final end = (endDate ?? DateTime.now()).toUtc().add(const Duration(days: 7));
196196
final events = await _calendarApi.retrieveEvents(
197197
calendarId: calendarId,
198198
startDate: start.millisecondsSinceEpoch,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: eventide
22
description: "Provides a easy-to-use flutter interface to access & modify native device calendars (iOS & Android)"
3-
version: 0.10.0
3+
version: 0.10.1
44
repository: https://github.com/sncf-connect-tech/eventide
55
topics:
66
- flutter

0 commit comments

Comments
 (0)