Merge pull request #2160 from Safelite/feature/cookieDebug

cookie date time fix
This commit is contained in:
CarlNation 2024-12-06 11:02:35 -05:00 committed by GitHub
commit ee2fd611b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -13,7 +13,7 @@ export function updateOrCreateFunnelCookie() {
// Set up cookie with all the props.
setFunnelCookieProperties({
LastTouched: new Date().toUTCString(),
LastTouched: new Date().toJSON(),
SavedSessionTimeoutDate: store.getters.applicationUser.savedSessionTimeout,
DidHeritageFunnelUpdateLast: false,
ShouldResetState: false,

View file

@ -43,5 +43,5 @@ Function to calculate the date for the saved session timeout.
export function getDateForSavedSessionTimeout() {
const currentDate = new Date(new Date().toUTCString());
currentDate.setDate(currentDate.getDate() + applicationConfig.SAVED_SESSION_TIMEOUT_DAYS);
return currentDate.toUTCString();
return currentDate.toJSON();
}

View file

@ -81,7 +81,7 @@ describe("getDateForSavedSessionTimeout", () => {
currentDate.setDate(currentDate.getDate() + applicationConfig.SAVED_SESSION_TIMEOUT_DAYS);
// Act
const result = getDateForSavedSessionTimeout();
const result = new Date(getDateForSavedSessionTimeout()).toUTCString();
// Assert
expect(result).toEqual(currentDate.toUTCString());