mtownsend5512/read-time

Minutes calculation cannot be 0

mtaltavull opened this issue · 3 comments

@mtownsend5512 Do you recall if there is a reason that the minutes calculation is set to 1 if it is < 1?

There are times when a short article will have a less than a minute read time. If displaying both minutes and seconds from the estimation, it incorrectly displays as something like "1 minute 45 second read time" instead of "45 second read time".

It mostly came from a pragmatic approach to what the package is trying to do. Normally, people don't concern themselves with the time it would take to read a Tweet vs when they open up an article.

Thanks @mtownsend5512. For context, I created a Drupal module that uses this package to estimate the read time for content. A user opened up an issue related to this. By default, only the minutes is displayed, but there is the option to display the seconds as well.

I'll think about if this should be fixed in the Drupal module. Or maybe we should no longer support displaying seconds.

@mtaltavull If you are interested in a PR to fix this issue in this repo I'd be happy to take a look at it