Why do momentjs isSameOrBefore and isSameOrAfter functions does not work for data which isBefore and isAfter work for?
Here are some very simple isolated examples where isSameOrBefore and isSameOrAfter does not work:
moment("2018-10-12 10:44:01").isSameOrBefore(moment("2018-10-12 10:44:00"))
TypeError: moment(...).isSameOrBefore is not a function [Learn More]
moment("2018-10-12 10:44:01").isSameOrAfter(moment("2018-10-12 10:44:02"))
TypeError: moment(...).isSameOrAfter is not a function [Learn More]
But yet with the same kind of data, isBefore and isAfter work fine:
moment("2018-10-12 10:44:01").isBefore(moment("2018-10-12 10:44:00"))
false
moment("2018-10-12 10:44:01").isAfter(moment("2018-10-12 10:44:02"))
false
moment("2018-10-12 10:44:00").isBefore(moment("2018-10-12 10:44:01"))
true
moment("2018-10-12 10:44:02").isAfter(moment("2018-10-12 10:44:01"))
true