Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress output when date is null, instead of "NaN years ago" #92

Open
momander opened this issue Jul 30, 2017 · 1 comment
Open

Suppress output when date is null, instead of "NaN years ago" #92

momander opened this issue Jul 30, 2017 · 1 comment

Comments

@momander
Copy link

If I put this in a template

{{row.timestamp | timeAgo}}

and row.timestamp is null or the property doesn't exist, the output is "NaN years ago". In my opinion that output is never intended by the developer or helpful for the user.

Instead, I propose the output should be null or an empty string. This would be analogous to what happens for null values if you do not use timeAgo. If row.timestamp is null and the template contains

{{row.timestamp}}

the output is empty.

Implementing this would also be useful for developers who want to leave some cells in a table empty, when there is no meaningful date to display for a particular row.

For example, a web-based game may have an Achievements page with a table with the columns "Name" and "Unlocked date". The unlocked achievements in the table would have dates in the second column, but the locked achievements would not.

@epugh
Copy link

epugh commented Dec 18, 2020

I have this same challenge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants