curDay = Ext.Date.parse(Ext.Date.format(new Date(), 'Y-m-d'), 'Y-m-d');
if(Ext.Date.parse(orderDate, 'Y-m-d') < curDay) {
Ext.Msg.alert(NLC.Message.app.ajax_Msg_tTip, '预约日期必须晚于当前日期');return;
文档上
http://docs.sencha.com/touch/2.3.1/#!/api/Ext.DateExtras-method-parseDate
/** * Parses the passed string using the specified date format. * Note that this function expects normal calendar dates, meaning that months are 1-based (i.e. 1 = January). * The {@link #defaults} hash will be used for any date value (i.e. year, month, day, hour, minute, second or millisecond) * which cannot be found in the passed string. If a corresponding default date value has not been specified in the {@link #defaults} hash, * the current date's year, month, day or DST-adjusted zero-hour time value will be used instead. * Keep in mind that the input date string must precisely match the specified format string * in order for the parse operation to be successful (failed parse operations return a `null` value). * * Example: * * // dt = Fri May 25 2007 (current date) * var dt = new Date(); * * // dt = Thu May 25 2006 (today's month/day in 2006) * dt = Ext.Date.parse("2006", "Y"); * * // dt = Sun Jan 15 2006 (all date parts specified) * dt = Ext.Date.parse("2006-01-15", "Y-m-d"); * * // dt = Sun Jan 15 2006 15:20:01 * dt = Ext.Date.parse("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A"); * * // attempt to parse Sun Feb 29 2006 03:20:01 in strict mode * dt = Ext.Date.parse("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // null * * @param {String/Number} input The raw date string. * @param {String} format The expected date string format. * @param {Boolean} [strict=false] (optional) `true` to validate date strings while parsing (i.e. prevents JavaScript Date "rollover"). * Invalid date strings will return `null` when parsed. * @re还有个 isvalid
/** * Checks if the passed Date parameters will cause a JavaScript Date "rollover". * @param {Number} year 4-digit year. * @param {Number} month 1-based month-of-year. * @param {Number} day Day of month. * @param {Number} [hour] Hour. * @param {Number} [minute] Minute. * @param {Number} [second] Second. * @param {Number} [millisecond] Millisecond. * @return {Boolean} `true` if the passed parameters do not cause a Date "rollover", `false` otherwise. */ isValid : function(y, m, d, h, i, s, ms) { // setup defaults h = h || 0; i = i || 0; s = s || 0; ms = ms || 0; // Special handling for year < 100 var dt = utilDate.add(new Date(y < 100 ? 100 : y, m - 1, d, h, i, s, ms), utilDate.YEAR, y < 100 ? y - 100 : 0); return y == dt.getFullYear() && m == dt.getMonth() + 1 && d == dt.getDate() && h == dt.getHours() && i == dt.getMinutes() && s == dt.getSeconds() && ms == dt.getMilliseconds(); },