This commit is contained in:
AllenFang
2019-07-13 15:28:12 +08:00
parent 46258b0264
commit 92f1449177
9 changed files with 169 additions and 7 deletions
@@ -69,8 +69,9 @@ const endDate = new Date();
export const stockGenerator = (quantity = 5) =>
Array.from({ length: quantity }, (value, index) => ({
id: index,
name: `Todo item ${index}`,
name: `Stock Name ${index}`,
price: Math.floor((Math.random() * 2) + 1),
visible: Math.random() > 0.5,
inStockDate:
new Date(startDate.getTime() + Math.random() * (endDate.getTime() - startDate.getTime()))
}));