Prefilter Records by Current Year, Month, Week, Day

The given code snippets are for filtering records based on different time periods – year, month, week, and day – compared to the current date.

year(createdAt) = year(NOW()): Filters records created in the current year.
month(createdAt) = month(NOW()): Filters records created in the current month.
week(createdAt) = week(NOW()): Filters records created in the current week.
day(createdAt) = day(NOW()): Filters records created on the current day.

:beer: + :beer: = :beers:

2 Likes