Jquery设置日期并显示本地格式Chrome OK,FF Not
如果我使用jquery将日期字符串如Jquery设置日期并显示本地格式Chrome OK,FF Not,jquery,google-chrome,date,firefox,Jquery,Google Chrome,Date,Firefox,如果我使用jquery将日期字符串如2015-12-31设置为日期输入字段,google chrome将显示德国日期样式如31.12.2015,Firefox将显示日期如2015-12-31 //will work in FF and chrome $('#dateinput').val('2015-12-31'); //but FF displays 2015-12-31 whereas chrome displays 31.12.2015 是否有任何浏览器兼容的解决方案使所有
2015-12-31
设置为日期输入字段,google chrome将显示德国日期样式如31.12.2015
,Firefox将显示日期如2015-12-31
//will work in FF and chrome
$('#dateinput').val('2015-12-31');
//but FF displays 2015-12-31 whereas chrome displays 31.12.2015
是否有任何浏览器兼容的解决方案使所有浏览器显示德语(用户本地)日期格式
如果我将字符串更改为:
$('#dateinput').val('31.12.2015');
//will not be accepted as a valid date from chrome.
Chrome无法使用此值 尝试使用正确的日期字符串格式:
2015-12-31T00:00:00Z
看看这是否有效