This commit is contained in:
wayanrivan
2025-04-29 15:21:42 +07:00
parent 5a4c0d1b74
commit 4365a0c842
2 changed files with 31 additions and 16 deletions

View File

@ -267,7 +267,7 @@ const DashboardHomePage = () => {
<Card
title="Total Cash-in"
total={responseStatisticCard?.data.total_cash_in ?? 0}
growth={parseFloat((responseStatisticCard?.data?.cash_in_last_week.percent ?? 0).toFixed(2))?? 0}
growth={parseFloat((responseStatisticCard?.data?.cash_in_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.cash_in_last_week.surplus ?? false}
icon="test"
/>
@ -302,7 +302,14 @@ const DashboardHomePage = () => {
type="date"
name="from"
value={moment(fromDate).format('YYYY-MM-DD')}
onChange={(e) => setFromDate(new Date(e.target.value))}
onChange={(e) => {
if (e.target.value) {
setFromDate(new Date(e.target.value));
} else {
// Reset to default value (e.g. first day of current month)
setFromDate(getFirstDayOfMonth());
}
}}
/>
</label>
@ -312,7 +319,14 @@ const DashboardHomePage = () => {
type="date"
name="to"
value={moment(toDate).format('YYYY-MM-DD')}
onChange={(e) => setToDate(new Date(e.target.value))}
onChange={(e) => {
if (e.target.value) {
setToDate(new Date(e.target.value));
} else {
// Reset to default value (e.g. today)
setToDate(getToday());
}
}}
/>
</label>
</div>