fix profile card display invalid date when profile doesn't have a expire date. (#85)

This commit is contained in:
BugGeeker 2024-08-26 10:40:05 +08:00 committed by GitHub
parent 890790ca4f
commit 9b081a5adb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -228,7 +228,9 @@ const ProfileItem: React.FC<Props> = (props) => {
className={`mt-2 flex justify-between ${isCurrent ? 'text-white' : 'text-foreground'}`}
>
<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>
)}
{info.type === 'local' && (

View File

@ -114,7 +114,9 @@ const ProfileCard: React.FC = () => {
className={`mt-2 flex justify-between ${match ? 'text-white' : 'text-foreground'} `}
>
<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>
)}
{info.type === 'local' && (