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

🚀 Added support for multiple day events #17

Conversation

Ujas-Majithiya
Copy link

No description provided.

@Ujas-Majithiya Ujas-Majithiya force-pushed the multi-day-event-support branch from cacd42b to b72e7db Compare October 11, 2021 07:29
CHANGELOG.md Outdated
@@ -1,3 +1,7 @@
# 0.0.3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make this tag as unreleased

if (_events[i].addEvent(event)) {
_eventList.add(event);
assert(event.endDate.difference(event.date).inDays >= 0,
'End date must be greater or equal to start date');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar mistake : The end date must be greater or equal to the start date

_rangingEventList.add(event);
_eventList.add(event);
} else {
for (var i = 0; i < _events.length; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use for in loop here?

_eventList.add(event);
} else {
for (var i = 0; i < _events.length; i++) {
if (_events[i].year == event.date.year) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two if condition can be handled with && operator.

@@ -103,6 +113,37 @@ class EventController<T> extends ChangeNotifier {
}
}

for (var i = 0; i < _rangingEventList.length; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use for in loop here ?

@@ -103,6 +113,37 @@ class EventController<T> extends ChangeNotifier {
}
}

for (var i = 0; i < _rangingEventList.length; i++) {
final days = <DateTime>[];
for (var d = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use for in loop here ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable names in not proper

.difference(_rangingEventList[i].date)
.inDays;
k++) {
if (days[k].year == date.year) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiple if conditions can be handled with && operator

}

if (_rangingEventList[i].date.isBefore(_rangingEventList[i].endDate)) {
for (var k = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use for in loop here ?

@Ujas-Majithiya Ujas-Majithiya force-pushed the multi-day-event-support branch 11 times, most recently from 5d285bc to 758d114 Compare October 12, 2021 09:29
README.md Outdated
event: "Event 1",
);

CalendarControllerProvider.of(context).controller.remove(event);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be add now remove.

@Ujas-Majithiya Ujas-Majithiya force-pushed the multi-day-event-support branch from 758d114 to 6466ec0 Compare October 12, 2021 09:44
@Ujas-Majithiya Ujas-Majithiya force-pushed the multi-day-event-support branch from 6466ec0 to c790965 Compare October 12, 2021 10:55
CHANGELOG.md Outdated
@@ -1,3 +1,7 @@
# unreleased

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be like # [0.0.3] - October 11, 2021 [Unreleased]

if (_events[i].year == event.date.year) {
if (_events[i].addEvent(event)) {
assert(event.endDate.difference(event.date).inDays >= 0,
'The end date must be greater or equal to start date');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end date must be greater or equal to the start date

@vatsaltanna-simformsolutions vatsaltanna-simformsolutions merged commit 10e286b into SimformSolutionsPvtLtd:master Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants