Skip to content

Commit

Permalink
count current conferences as starting today
Browse files Browse the repository at this point in the history
to determine the correct number of important events to be shown
  • Loading branch information
paolini committed Sep 12, 2024
1 parent 84cceaf commit d18ef9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dm-monitor",
"type": "module",
"version": "2.1.0",
"version": "2.1.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/eventsAndVisitorsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ function renderEvents(events) {

let number_of_events_in_the_same_day = 0;
var first_event_date = null;
var today_date = moment().format('YYYY-MM-DD');
for (var i = 0; i < events.length; i++) {
var event_date = events[i]?events[i].startDatetime.format('YYYY-MM-DD'):'';
if (event_date < today_date) event_date = today_date; // le conferenze iniziano nel passato
if (event_date && !first_event_date) first_event_date = event_date;
if (event_date == first_event_date) {
number_of_events_in_the_same_day++;
Expand Down

0 comments on commit d18ef9b

Please sign in to comment.