默认情况下,datepicker的格式是MM / DD / YYYY,我希望它是DD / MM / YYYY,有没有办法改变它?
答案 0 :(得分:1)
答案 1 :(得分:1)
如果您无法将区域设置更改为DD / MM / YYYY,则可以尝试对datepicker绑定进行子类化并覆盖_init
方法。您需要设置以下属性:
this._separatorFirst.value = '/';
this._separatorSecond.value = '/';
this.dayField = document.getAnonymousElementByAttribute(this, "anonid", "input-one");
this.monthField = document.getAnonymousElementByAttribute(this, "anonid", "input-two");
this.yearField = document.getAnonymousElementByAttribute(this, "anonid", "input-three");
this.yearField.parentNode.className = "datetimepicker-input-subbox datetimepicker-year";
this.yearField.size = 4;
this.yearField.maxLength = 4;
this.yearLeadingZero = true;
this.monthLeadingZero = true;
this.dayLeadingZero = true;
this._fieldAMPM.parentNode.collapsed = true;
另外,请考虑提交增强请求以覆盖具有属性和/或属性的格式。