So, I have a JS moment, and I need to display the time until next Sunday in human readable words:
Next Sunday will be in 5 days, 4 hours, 30 minutes, and 10 seconds.
The moment has a from method, but not an until method.
from
until
There is a moment.fromNow () function here that shows things like "after 5 months" or "3 years ago."
http://momentjs.com/docs/#/displaying/fromnow/
why don't you try # moment on
a.to(b) // "in a day"
like for next sunday,
moment().endOf("week");
can do the trick.
so basically the code you need will be
var now = moment(); var nextSunday = moment().endOf("week"); now.to(nextSunday)
Source: https://habr.com/ru/post/1491766/More articles:WebSharper issue on startup - f #What is this button artifact when choosing a UIButton? - selectedHow to create a nested center and south in the jQuery UI Layout Plug-in? - jqueryMatlab Mex code does not compile - c ++https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1491765/adding-maven-dependencies-to-gradle-in-android-studio&usg=ALkJrhiJ5uwfM6pcoJhlZI1AdF6ONqfg2QPerspective transformation OpenCV, giving an unexpected result - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1491768/working-with-hosted-git-repositories-and-sublime-text&usg=ALkJrhgzkc5FMgqmEO6YDEXnDp13gsjjJAThe "<<" operator in verilog - operator-keywordmakeKeyAndOrderFront does not - objective-cHibernation integration with Spring does not work in hippo cms site project - springAll Articles