Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Pass correct type to isInRange extension for calculateAvailableEventsForRange function #27

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.3.0

- Updated dependencies

# 1.2.1

- Updated dependencies
Expand Down
10 changes: 6 additions & 4 deletions lib/src/utils/event_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ List<CalendarEventModel> calculateAvailableEventsForRange(
DateTime.utc(event.begin.year, event.begin.month, event.begin.day);
final eventEndUtc =
DateTime.utc(event.end.year, event.end.month, event.end.day);
if (eventStartUtc.toJiffy().isInRange(start, end) ||
eventEndUtc.toJiffy().isInRange(start, end) ||
(start?.isInRange(eventStartUtc, eventEndUtc) ?? false) ||
(end?.isInRange(eventStartUtc, eventEndUtc) ?? false)) {
final eventStartUtcJiffy = eventStartUtc.toJiffy();
final eventEndUtcJiffy = eventEndUtc.toJiffy();
if (eventStartUtcJiffy.isInRange(start, end) ||
eventEndUtcJiffy.isInRange(start, end) ||
(start?.isInRange(eventStartUtcJiffy, eventEndUtcJiffy) ?? false) ||
(end?.isInRange(eventStartUtcJiffy, eventEndUtcJiffy) ?? false)) {
eventsHappen.add(event);
}
}
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cr_calendar
description: Awesome calendar with customizations, range picking and event showing.
version: 1.2.1
version: 1.3.0
homepage: https://cleveroad.com
repository: https://github.com/Cleveroad/cr_calendar

Expand All @@ -19,8 +19,8 @@ dependencies:
flutter:
sdk: flutter

intl: ^0.18.1
jiffy: ^6.2.1
intl: ^0.19.0
jiffy: ^6.3.1
scrollable_positioned_list: ^0.3.8

dev_dependencies:
Expand Down