Skip to content

Commit

Permalink
Merge pull request #213 from lryanle/133/clean-fb-attributes
Browse files Browse the repository at this point in the history
fixed time comparisons
  • Loading branch information
lryanle authored Apr 5, 2024
2 parents 1a72f27 + 7a322d9 commit 83dc709
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/app/api/listings/day/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ async function getListingsByDay(before?: string, after?: string) {

// Normalize and format the dates
const beforeDate = before ? new Date(before) : new Date();
beforeDate.setUTCHours(0, 0, 0, 0);
beforeDate.setUTCHours(23, 59, 59, 999);
beforeDate.setDate(beforeDate.getDate() - 1);
const afterDate = after ? new Date(after) : new Date();
afterDate.setUTCHours(23, 59, 59, 999);
afterDate.setUTCHours(0, 0, 0, 0);
afterDate.setDate(afterDate.getDate() - 1);

const formattedBeforeDate = beforeDate.toISOString();
const formattedAfterDate = afterDate.toISOString();

console.log('formattedBeforeDate', formattedBeforeDate, 'formattedAfterDate', formattedAfterDate);

const results = await db.collection('listings').aggregate([
{
$match: {
Expand Down

1 comment on commit 83dc709

@vercel
Copy link

@vercel vercel bot commented on 83dc709 Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

seniordesign – ./

seniordesign-lryanle.vercel.app
smare.lryanle.com
smare.vercel.app
seniordesign-git-main-lryanle.vercel.app

Please sign in to comment.