Incorrect display of dates
mprasanjith opened this issue · 2 comments
The UI does not show the year when showing dates.
In this scenario, the actual date is Aug 29. 2018, while the UI just shows Aug 29. The same issue is present in sale cards as well.
This issue can be reproduced by using the subgraph mocks.
Potential solution would be to optionally show the year only for years other than the current. We can also use something like formatDistance
or formatRelative
of data-fns library to have much more human-readable dates.
PS: formatDistanceToNowStrict
is exactly what we need, although I'm not sure if we should use date-fns as well as we have dayjs in our code.
It wasn't included in the figma designs originally. I'm not familiar with the data-fns
library. If we only need a single function from that library can we not just write the function using dayjs ourselves?. I raise this because as you have said before in #409 the bundle size is quite large.
Yeah I agree we should definitely use dayjs. I didn't quite realize we have it in our codebase when I added the original description. Introducing human readable dates is an additional thing anyway, but we should show the year to the user, or its very misleading.