Short question: I need momentjs to humanize 60 minutes into 1 hour
instead of an hour
. Can't figure out how to get it to work.
Long question: Just started using momentjs, works great. We are using it to display how often a dashboard is updated.
The timers are set as a integer in minutes. We are using the humanize moment option to display 30
as 30 minutes
and 360
as 6 hours
etc.
This works great but not in 2 cases. 60
gets humanized to an hour
. We need it to be 1 hour
. And 1440
is displayed as a day
, instead of 1 day
.
We need this change because the column is answering the question "How often does your metric update?"
The answer is "every 1 hour". "every an hour" doesn't quite work.
I read through the docs and googled, but couldn't find a way to customize just a few humanized display formats.
We are already setting true as the second parameter to get just the value without the suffix from this question and answer - How to Customize Humanized Moment js Date Result
But the value comes back as 'an hour' instead of '1 hour'.