Merge pull request #3703 from omnivore-app/feat/api-last24-query

Add last24hrs query for time based search queries to get recently saved/changed items
This commit is contained in:
Jackson Harper 2024-03-20 20:55:33 +08:00 committed by GitHub
commit 75a958c168
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -396,6 +396,20 @@ export const buildQueryString = (
endDate = yesterday.endOf('day').toJSDate()
break
}
case 'last12hrs':
{
const ago = new Date()
ago.setHours(ago.getHours() - 12)
startDate = ago
}
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