From a431a58fd558adf7369afab9ad27996f97c7eba4 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 11 Dec 2024 13:41:36 -0500 Subject: [PATCH 1/2] date functions use client browser for date parts date functions use client browser for date parts. just parse it instead --- src/store/index.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 97fac2d0b..d5fa1e0d9 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2100,15 +2100,10 @@ export const actions = { ) { const order = context.state.order; - var dt = new Date(referralDate); - var month = "" + (dt.getMonth() + 1); - var day = "" + dt.getDate(); - const year = dt.getFullYear(); - - if (month.length < 2) - month = "0" + month; - if (day.length < 2) - day = "0" + day; + var dtParts = referralDate.split("-"); + const year = dtParts[0]; + const month = dtParts[1]; + const day = dtParts[2].substring(0, 2); const loadDate = `${year}-${month}-${day}`; From 33166f71c664dbeaf5f140822aa4d3f0070dc155 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 11 Dec 2024 13:58:33 -0500 Subject: [PATCH 2/2] tests tests --- src/store/store.spec.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/store/store.spec.js b/src/store/store.spec.js index 094793bc1..69e2feb66 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -784,6 +784,7 @@ describe("Actions", () => { const response = await actions.loadSession(context, { payload: { savedSessionId: "", + referralDate: "2024-12-11T00:29:41.967", }, pageNameToLog: "test", }); @@ -813,6 +814,7 @@ describe("Actions", () => { const response = await actions.loadSession(context, { payload: { savedSessionId: "", + referralDate: "2024-12-11T00:29:41.967", }, pageNameToLog: "test", }); @@ -841,6 +843,7 @@ describe("Actions", () => { const response = await actions.loadSession(context, { payload: { savedSessionId: "", + referralDate: "2024-12-11T00:29:41.967", }, pageNameToLog: "test", });