diff --git a/src/components/ZakatYearInfo.jsx b/src/components/ZakatYearInfo.jsx index 1a050d6..2e9b050 100644 --- a/src/components/ZakatYearInfo.jsx +++ b/src/components/ZakatYearInfo.jsx @@ -97,7 +97,11 @@ function ZakatYearInfo({ zakatYear }) { > Closing Balance - {formatMoney(zakatYear?.closingBalance)} + + {zakatYear?.closingBalance + ? formatMoney(zakatYear?.closingBalance) + : 'N/A'} + Closin Nisaab - {formatMoney(zakatYear?.closingNisab)} + + {zakatYear?.closingNisab + ? formatMoney(zakatYear?.closingNisab) + : 'N/A'} + { const costPrice = Math.round(Math.random() * 10000000) / 100 const profit = Math.round(Math.random() * 20 * costPrice) / 100 @@ -22,6 +29,7 @@ export const products = temp.map((name) => { costPrice, quantity: Math.ceil(Math.random() * 100), basePrice: costPrice + profit, + lastOrderDate: new Date(), } }) diff --git a/src/utils/dateFunctions.js b/src/utils/dateFunctions.js index e3a04fa..c61fb18 100644 --- a/src/utils/dateFunctions.js +++ b/src/utils/dateFunctions.js @@ -30,7 +30,6 @@ export const toDdMmmYy = (dateObj) => { */ export const cleanDate = (date) => { - if (typeof date === Date) return date if (!(date instanceof Date)) { if (date?.hasOwnProperty('seconds')) date = new Date(date?.seconds * 1000 + date?.nanoseconds / 1000000)