angular-sanctuary / angular-hub

Curated list of Angular events and communities
https://angular-hub.com/
MIT License
49 stars 29 forks source link

[Bug]: "Upcoming events this week" under "Discover" page does not show events happening today #133

Closed ajitzero closed 10 months ago

ajitzero commented 10 months ago

Relevant scope

angular application

Description

"Upcoming events this week" under "Discover" page does not show today's events. There are two events happening today, which can be seen under the "Upcoming" section on the actual "Agenda" (/events) page.

It should include events happening today.

Do you want to contribute with a pull request?

Yes

ajitzero commented 10 months ago

I'm thinking to update this part... https://github.com/angular-sanctuary/angular-hub/blob/5b3d1e3e17ae19efb0944efe0d4fd584306091a8/angular-hub/src/app/pages/discover/index.page.ts#L120-L124 ...to include the current date, using isToday from date-fns.

-  .filter((event) => isFuture(new Date(event.attributes.date)));
+  .filter((event) => {
+    const date = new Date(event.attributes.date);
+    return isToday(date) || isFuture(date));
+  });

Also, I would fix the typo with the isThisSOWeek import, to isThisISOWeek.

geromegrignon commented 10 months ago

Hi, great change indeed, I can reproduce it.

Not prioritized yet but I need to update the 'date' model to accept hours so it'll be easier to deal with real 'future' events.