Momentjs comparing full ISO string not working

Viewed 23

momentJS comparing in full ISO string never works

moment("2021-08-11T19:22:000+08:00").isAfter("2021-08-11T17:22:000+08:00", "minute") // false
moment("2021-08-11T15:22:000+08:00").isAfter("2021-08-11T17:22:000+08:00", "minute") // false
moment("2021-08-11T15:20:000+08:00").isAfter("2021-08-11T17:50:000+08:00", "minute") // false
moment("2021-08-11T19:22:000+08:00").isAfter("2021-08-11T17:16:000+08:00", "minute") // false


1 Answers
moment("2021-08-11T19:22:000+08:00").isAfter("2021-08-11T17:22:000+08:00", "minute") // false

sorry my bad. formatting error. missing seconds values

moment("2021-08-11T19:22:000+08:00") // incorrect
moment("2021-08-11T19:22:00.000+08:00") // correct
Related