Var olddate = new date (), momentobj = moment. Using moment.js i can't transform a correct moment object to a date object with timezones. Format('e') stands for day of week.
The Moment We've Been Waiting For... — Katie Gustafson
I can't get the correct date.
To use this in only one place instead of overwriting the locales, pass a string of your choice as the first argument when you define the moment.updatelocale and then invoke the calendar method using.
I know this has already been answered, but i stumbled across this question and went down the path of using format, which works, but it returns them as strings when i wanted integers. I'm able to get the difference between two dates using momentjs as follows: I'm using moment.js to format my date time, here i have two date values, and i want to achieve a particular function when one date is greater than the other. Change the language of moment.js by using the locale method to set or get the desired language.
You probably don't need moment.js anymore moment is great time manipulation library but it's considered as a legacy project, and the team is recommending to use other libraries. Moment (end.diff (starttime)).format (m [m] s [s]) however, i also want to display the hour when applicable (only.