From 1f07d9fa484af4080adc596f4fc948be099a1e35 Mon Sep 17 00:00:00 2001 From: Ethan Alvizo Date: Thu, 1 Jun 2023 03:20:04 -0400 Subject: [PATCH] fix: DateWrapper fails on first day of month --- packages/jsapi-utils/src/TableUtils.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/jsapi-utils/src/TableUtils.test.ts b/packages/jsapi-utils/src/TableUtils.test.ts index 6aa271e512..daa5b3b367 100644 --- a/packages/jsapi-utils/src/TableUtils.test.ts +++ b/packages/jsapi-utils/src/TableUtils.test.ts @@ -2459,13 +2459,18 @@ describe('makeValue', () => { now.getMonth(), now.getDate() ); - const yesterdayDate = DateUtils.makeDateWrapper( - dh, - 'America/New_York', + const yesterday = new Date( now.getFullYear(), now.getMonth(), now.getDate() - 1 ); + const yesterdayDate = DateUtils.makeDateWrapper( + dh, + 'America/New_York', + yesterday.getFullYear(), + yesterday.getMonth(), + yesterday.getDate() + ); testMakeValue( 'io.deephaven.db.tables.utils.DBDateTime', 'today',