Relative Content

Tag Archive for javascriptmomentjs

moment JS returning NaN on common date

I’m trying to get thisDate in milliseconds using moment.js and I’m getting NaN when I run the valueOf() method. I’m honestly clueless as to why this isn’t working considering my date is a pretty standard date.

Why moments comparison is wrong?

I have two valid Moment instances: endDateTime and startDateTime. endDateTime is earler than startDateTime. Why isBefore always returns false and isSame always returns true?

how can we remove th or nd from date in moment

moment(availability[0].StartDate).locale(locale) .format(‘Do’) In the image, there’s a th suffix appearing after the number 25. Please ensure this suffix is removed when updating the date using Moment.js. In the image, there’s a th suffix appearing after the number 25. Please ensure this suffix is removed when updating the date using Moment.js. javascript momentjs 1 moment(availability[0].StartDate).locale(locale) .format(‘D’)