mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 21:20:29 +08:00
fix profile card display invalid date when profile doesn't have a expire date. (#85)
This commit is contained in:
parent
890790ca4f
commit
9b081a5adb
@ -228,7 +228,9 @@ const ProfileItem: React.FC<Props> = (props) => {
|
|||||||
className={`mt-2 flex justify-between ${isCurrent ? 'text-white' : 'text-foreground'}`}
|
className={`mt-2 flex justify-between ${isCurrent ? 'text-white' : 'text-foreground'}`}
|
||||||
>
|
>
|
||||||
<small>{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined}</small>
|
<small>{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined}</small>
|
||||||
<small>{extra ? dayjs.unix(extra.expire).format('YYYY-MM-DD') : ''}</small>
|
<small>
|
||||||
|
{extra && extra.expire ? dayjs.unix(extra.expire).format('YYYY-MM-DD') : ''}
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{info.type === 'local' && (
|
{info.type === 'local' && (
|
||||||
|
|||||||
@ -114,7 +114,9 @@ const ProfileCard: React.FC = () => {
|
|||||||
className={`mt-2 flex justify-between ${match ? 'text-white' : 'text-foreground'} `}
|
className={`mt-2 flex justify-between ${match ? 'text-white' : 'text-foreground'} `}
|
||||||
>
|
>
|
||||||
<small>{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined}</small>
|
<small>{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined}</small>
|
||||||
<small>{extra ? dayjs.unix(extra.expire).format('YYYY-MM-DD') : ''}</small>
|
<small>
|
||||||
|
{extra && extra.expire ? dayjs.unix(extra.expire).format('YYYY-MM-DD') : ''}
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{info.type === 'local' && (
|
{info.type === 'local' && (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user