Skip to content

Commit

Permalink
Final Fixes II
Browse files Browse the repository at this point in the history
  • Loading branch information
mamt4real committed Oct 8, 2023
1 parent f25c476 commit 977a7a7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/components/ZakatYearInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ function ZakatYearInfo({ zakatYear }) {
>
<AccountBalanceWalletOutlinedIcon /> Closing Balance
</Typography>
<Typography>{formatMoney(zakatYear?.closingBalance)}</Typography>
<Typography>
{zakatYear?.closingBalance
? formatMoney(zakatYear?.closingBalance)
: 'N/A'}
</Typography>
</Box>
<Box display={'flex'} gap={1}>
<Typography
Expand All @@ -109,7 +113,11 @@ function ZakatYearInfo({ zakatYear }) {
>
<MonetizationOnOutlinedIcon /> Closin Nisaab
</Typography>
<Typography>{formatMoney(zakatYear?.closingNisab)}</Typography>
<Typography>
{zakatYear?.closingNisab
? formatMoney(zakatYear?.closingNisab)
: 'N/A'}
</Typography>
</Box>
<Box display={'flex'} gap={1}>
<Typography
Expand Down
10 changes: 9 additions & 1 deletion src/devdata/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ export const users = Array(4)
}))

// Dummy Products
const temp = ['TIGER ELEMAX', 'YAMAHA', 'TECH', 'TECH', 'BIBUT']
const temp = [
'TIGER ELEMAX',
'YAMAHA',
'TECH',
'TECH',
'BIBUT',
'4ft X 4ft Window',
]
export const products = temp.map((name) => {
const costPrice = Math.round(Math.random() * 10000000) / 100
const profit = Math.round(Math.random() * 20 * costPrice) / 100
Expand All @@ -22,6 +29,7 @@ export const products = temp.map((name) => {
costPrice,
quantity: Math.ceil(Math.random() * 100),
basePrice: costPrice + profit,
lastOrderDate: new Date(),
}
})

Expand Down
1 change: 0 additions & 1 deletion src/utils/dateFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 977a7a7

Please sign in to comment.