mirror of
https://github.com/status-im/status-web.git
synced 2026-08-31 06:11:10 +00:00
add year to date in transaction history (#797)
* add year to date if transaction is from last year or older * Create cyan-waves-wave.md
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@status-im/wallet": patch
|
||||
---
|
||||
|
||||
add year to date in transaction history
|
||||
@@ -1,4 +1,4 @@
|
||||
import { format, isToday, isYesterday } from 'date-fns'
|
||||
import { format, isThisYear, isToday, isYesterday } from 'date-fns'
|
||||
|
||||
type Props = {
|
||||
timestamp: Date | string | number
|
||||
@@ -16,7 +16,12 @@ export const RelativeDate = (props: Props) => {
|
||||
if (isYesterday(date)) {
|
||||
return `Yesterday ${format(date, 'HH:mm')}`
|
||||
}
|
||||
return format(date, 'dd MMMM HH:mm')
|
||||
|
||||
if (isThisYear(date)) {
|
||||
return format(date, 'dd MMMM HH:mm')
|
||||
}
|
||||
|
||||
return format(date, 'dd MMMM yyyy HH:mm')
|
||||
}
|
||||
|
||||
return <span className={className}>{formatDate()}</span>
|
||||
|
||||
Reference in New Issue
Block a user