Skip to content

Commit

Permalink
Merge pull request #214 from lryanle/133/clean-fb-attributes
Browse files Browse the repository at this point in the history
I HOPE THIS TIME COMPARISON WORKS!
  • Loading branch information
lryanle authored Apr 5, 2024
2 parents 83dc709 + de99057 commit 0e0a3e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions frontend/app/api/listings/day/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ async function getListingsByDay(before?: string, after?: string) {
// Normalize and format the dates
const beforeDate = before ? new Date(before) : new Date();
beforeDate.setUTCHours(23, 59, 59, 999);
beforeDate.setDate(beforeDate.getDate() - 1);
const afterDate = after ? new Date(after) : new Date();
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);
// formattedBeforeDate 2024-04-04T23:59:59.999Z formattedAfterDate 2024-03-05T00:00:00.000Z

const results = await db.collection('listings').aggregate([
{
Expand Down
7 changes: 5 additions & 2 deletions frontend/components/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ import DownloadCSV from "@/components/dashboard/DownloadCSV";
type Props = {};

export default function Dashboard({}: Props) {
const localTime = new Date();
const today = new Date(localTime.getTime() + (localTime.getTimezoneOffset() * 60000));

const [date, setDate] = useState<DateRange | undefined>({
from: addDays(new Date(), -30),
to: new Date(),
from: addDays(today, -30),
to: today,
});

return (
Expand Down

1 comment on commit 0e0a3e7

@vercel
Copy link

@vercel vercel bot commented on 0e0a3e7 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 – ./

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

Please sign in to comment.