function convertDateFromString(dateString) { if (dateString) { var date = new Date(dateString.replace(/-/, "/")) return date; } } var a=this.options.form.getWidgetByName("yearsed"); var b=this.options.form.getWidgetByName("endyearsed"); var st =new Date(a.getValue()); var ed = new Date(b.getValue()); if (st>ed) { FR.Msg.alert("警告", "开始时间要小于结束时间!"); //FR.Msg.alert("66",a.getValue()) return false; } if (st.getYear()!=ed.getYear()){ FR.Msg.alert("警告", "开始时间和结束时间要是同一年!"); return false; }