From 0df862450530af8e0560a3381ab8b5238fe071c0 Mon Sep 17 00:00:00 2001 From: Samejima <46758064+samejima-san@users.noreply.github.com> Date: Sun, 17 Sep 2023 23:31:13 -0400 Subject: [PATCH] adding timestamp to cart (#332) --- use-shopping-cart/core/Entry.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/use-shopping-cart/core/Entry.js b/use-shopping-cart/core/Entry.js index 3b9dca76..95ac9342 100644 --- a/use-shopping-cart/core/Entry.js +++ b/use-shopping-cart/core/Entry.js @@ -1,4 +1,5 @@ import { isClient } from '../utilities/SSR' +import { formatISO } from 'date-fns' export const formatCurrencyString = ({ value, @@ -78,7 +79,8 @@ export function createEntry({ product, quantity: count, price_metadata, - product_metadata + product_metadata, + timeStamp: formatISO(new Date()) }) state.cartDetails[id] = entry