Fix more date math problems.

This commit is contained in:
Sam Rose 2024-05-20 12:31:12 +01:00
parent 079318379d
commit fd2e0020cd
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -249,9 +249,13 @@ describe.each([
let globalUsers: any = []
const serverTime = new Date()
// In MariaDB and MySQL we only store dates to second precision, so we need
// to remove milliseconds from the server time to ensure searches work as
// expected.
serverTime.setMilliseconds(0)
const future = new Date(serverTime.getTime())
future.setDate(future.getDate() + 30)
const future = new Date(serverTime.getTime() + 1000 * 60 * 60 * 24 * 30)
const rows = (currentUser: User) => {
return [