update LastLogin on login, show it.
remove end date for filter pubs for month; fix stats end date
This commit is contained in:
@ -228,7 +228,7 @@ async function getAvailabilities(userId) {
|
||||
}
|
||||
|
||||
|
||||
async function filterPublishersNew(selectFields, filterDate, isExactTime = false, isForTheMonth = false, isWithStats = true, includeOldAvailabilities = false) {
|
||||
async function filterPublishersNew(selectFields, filterDate, isExactTime = false, isForTheMonth = false, isNoEndDateFilter = false, isWithStats = true, includeOldAvailabilities = false) {
|
||||
|
||||
filterDate = new Date(filterDate); // Convert to date object if not already
|
||||
|
||||
@ -341,7 +341,7 @@ async function filterPublishersNew(selectFields, filterDate, isExactTime = false
|
||||
{
|
||||
dayOfMonth: { not: null },
|
||||
startTime: { gte: monthInfo.firstMonday },
|
||||
endTime: { lte: monthInfo.lastSunday }
|
||||
// endTime: { lte: monthInfo.lastSunday }
|
||||
},
|
||||
// Check if dayOfMonth is null and match by day of week using the enum (Assigments every week)
|
||||
{
|
||||
@ -358,6 +358,10 @@ async function filterPublishersNew(selectFields, filterDate, isExactTime = false
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
if (!isNoEndDateFilter) { // Check if we need to apply the endTime filter
|
||||
whereClause["availabilities"].some.OR[0].endTime = { lte: monthInfo.lastSunday };
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`getting publishers for date: ${filterDate}, isExactTime: ${isExactTime}, isForTheMonth: ${isForTheMonth}`);
|
||||
|
Reference in New Issue
Block a user