0

I'm currently having a problem. I have two date-time fields a Start Date and an End Date. If i pick a date on the Start date for example October 2,2016 and pick a date on the End date October 1,2016 an alert dialog box should appear that the end date is earlier than the Start Date. How do i validate this via script? Sorry i am still very new to programming.

Junnel
  • 107
  • 1
  • 16

1 Answers1

0

try this datetime lib, it has such function http://momentjs.com/docs/#/query/is-after/ it shoud be something like

if (moment(dateBefore).isAfter(dateAfter)) {do somth}
Pasha K
  • 357
  • 1
  • 7