javascript - i am using datetime picker and want that my start and end date must have difference of 24 hours -
Start time is: - 02/18/2014 11:00 Expiration Time is: -0/2/27/2014 09:33 I want to calculate the difference between 2 dates using jquery so that I can add verification that the user must keep the difference of 24 hours (1 day) when selecting a date.
this is jquery
var start = new date ("2014- 02-18 "); Var end = new date (); Var diff = new date (end-start); Var days = diff / 1000/60/60/24 // warning (day); If (day & lt; = 1) {warnings ("less then 1 day"); } And {warnings ("and 1 day"); }
This is jsfiddle for it
Comments
Post a Comment