6
我發現這個有用的代碼允許英國日期在Chrome中工作,但我不知道如何實現它。它覆蓋默認的日期功能。覆蓋jQuery的日期
date: function(value, element) {
//ES - Chrome does not use the locale when new Date objects instantiated:
//return this.optional(element) || !/Invalid|NaN/.test(new Date(value));
var d = new Date();
return this.optional(element) || !/Invalid|NaN/.test(new Date(d.toLocaleDateString(value)));
},
我如何將此添加到jQuery驗證以覆蓋默認功能。
Here is where我找到了代碼示例
我會建議使用類似的東西:http://www.datejs.com/ – Mrchief
如果你打算複製另一個問題的答案,至少給這個人的功勞。 (你甚至複製了他們的拼寫錯誤)http://stackoverflow.com/questions/5966244/jquery-datepicker-chrome –