Add last24hrs query for time based search queries to get recently saved/changed items

This commit is contained in:
Jackson Harper 2024-03-20 15:15:18 +08:00
parent 3abd1bf377
commit 82ef57a36a

View file

@ -396,6 +396,11 @@ export const buildQueryString = (
endDate = yesterday.endOf('day').toJSDate()
break
}
case 'last24hrs':
const ago = new Date()
ago.setHours(ago.getHours() - 24)
startDate = ago
break
case 'this week':
startDate = DateTime.local().startOf('week').toJSDate()
break