Answer the question
In order to leave comments, you need to log in
Which javascript library to choose for number declension for different languages?
Hello, tell me please.
I'm looking for a javascript library for declining numbers, more specifically in my case for minutes/hours.
For example, a number in seconds comes to me from the server, I divide it by 60 and get either minutes or hours. 1440 / 60 = 24
And most importantly, I need to show the user that it's 24 hours, or rather, for English localization, 24 hours .
Or 60 / 60 // 1 hour
Are there similar libraries that work with time and, what's more important, with localization?
Thanks for your help and your time.
Answer the question
In order to leave comments, you need to log in
momentjs.com
moment((new Date()).getTime() - 1440 * 60 * 1000).fromNow(); // a day ago
moment((new Date()).getTime() - 1440 * 60 * 1000).fromNow(true); // a day
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question