Skip to content

Commit

Permalink
Adjust the enddate correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mutugiii committed Dec 6, 2023
1 parent 5a1fabe commit e23db8a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/shared/calendar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,18 @@ export class PlanetCalendarComponent implements OnInit, OnChanges {
if (event?.start) {
meetup = {
startDate: event?.start,
endDate: event?.end
endDate: this.adjustEndDate(event?.end)
};
}

this.dialog.open(DialogsAddMeetupsComponent, {
data: { meetup: meetup, link: this.link, sync: this.sync, onMeetupsChange: this.onMeetupsChange.bind(this), editable: this.editable }
});
}

adjustEndDate(endDate: Date): Date {
return new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate() - 1, 23, 59, 59, 999);
}

onMeetupsChange() {
this.getMeetups();
}
Expand Down

0 comments on commit e23db8a

Please sign in to comment.