Skip to content

Commit 0df8624

Browse files
authored
adding timestamp to cart (#332)
1 parent 0d0f36b commit 0df8624

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

use-shopping-cart/core/Entry.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { isClient } from '../utilities/SSR'
2+
import { formatISO } from 'date-fns'
23

34
export const formatCurrencyString = ({
45
value,
@@ -78,7 +79,8 @@ export function createEntry({
7879
product,
7980
quantity: count,
8081
price_metadata,
81-
product_metadata
82+
product_metadata,
83+
timeStamp: formatISO(new Date())
8284
})
8385

8486
state.cartDetails[id] = entry

0 commit comments

Comments
 (0)