up
This commit is contained in:
@@ -207,7 +207,7 @@
|
||||
let occupied = 0;
|
||||
for (let d = 1; d <= days; d++) {
|
||||
const ds = `${today.getFullYear()}-${String(today.getMonth()+1).padStart(2,'0')}-${String(d).padStart(2,'0')}`;
|
||||
if (calEvents.some(e => ds >= e.start_date && ds < e.end_date)) occupied++;
|
||||
if (calEvents.some(e => ds >= e.start_date && (e.source === 'airbnb' ? ds < e.end_date : ds <= e.end_date))) occupied++;
|
||||
}
|
||||
return days > 0 ? Math.round((occupied/days)*100) : 0;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user