a text-input contains a german formatted date 15.09.2012
I simply use $('#wr_event_date').val() to query the value in the input-field.
I wonder how I can match that date agains “today”?
var eventDate = $('#wr_event_date').val();
// if eventDate is older than today as in "is over" doSomething();
So basically I want to check if the eventDate is older than today and if so I want to doSomething();
Ideas on that? Thank you in advance.
Unfortunately, you have to parse the date yourself. Then, fetch the current date with
new Date(), reset the time part, and compare both dates:DEMO.