I have a String called yourDate 2012-11-30. Now i need to compare this date with the system date to check if it has exceeded or equaled the system date.
How can i do this ?
My approach;
var tDay= Ext.Date.parse(“2012-11-30”, “Y-m-d”);
var sDay= new Date().dateformat(‘Y-m-d’); // system date
I get an error message TypeError: (new Date).dateformat is not a function. How can i correct this ?
note: I am using Extjs
Try the following:
But I don’t think you need to format your current date for comparison.
You can just use
var sDay = new Date()and then compare date objects likeif(sDay > tDay)