Is it possible to check whether an end date is greater than or equal to a start date in Javascript? My dates are strings in the format 'dd/mm/yyyy'.
标签:
javascript
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Just convert the string to date and use
getTime
method of Date object to compare it.Example code
Working Fiddle
try this
If the string format ('dd/mm/yyyy') doesn't change, this function should work:
Or extend the
Date.prototype
:check out this function
Try this,