Skip to content

Commit

Permalink
fix: display multi day events
Browse files Browse the repository at this point in the history
  • Loading branch information
geromegrignon committed Aug 20, 2024
1 parent b21aafe commit 4a7132b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion angular-hub/src/app/pages/index.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ export default class EventsComponent {
return this.events().filter((event) => {
return (
(this.date()
? isSameDay(new Date(event.date), new Date(this.date()!))
? event.endDate
? isWithinInterval(new Date(this.date()!), {
start: new Date(event.date),
end: new Date(event.endDate),
})
: isSameDay(new Date(event.date), new Date(this.date()!))
: true) &&
(this.selectedLanguage()
? event.language === this.selectedLanguage()
Expand Down Expand Up @@ -282,6 +287,8 @@ export default class EventsComponent {
month: number;
day: number;
}): boolean {
console.log(date);
console.log(this.events());
return this.events().some((event) => {
if (!event.endDate) {
return isSameDay(
Expand Down
6 changes: 3 additions & 3 deletions angular-hub/src/public/assets/data/community.json
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@
{
"name": "NG-DE Conference",
"type": "conference",
"date": "2024-10-09",
"date": "2024-10-9",
"endDate": "2024-10-11",
"url": "https://ng-de.org/",
"callForPapers": "null",
Expand All @@ -1449,8 +1449,8 @@
{
"name": "NG-BE 2024",
"type": "conference",
"date": "2024-12-05",
"endDate": "2024-12-06",
"date": "2024-12-5",
"endDate": "2024-12-6",
"url": "https://ng-be.org/",
"callForPapers": "null",
"callForPapersDueDate": "null",
Expand Down

0 comments on commit 4a7132b

Please sign in to comment.