在代码替换材料datetime- picker.js
if (!this.value) {
// TODO hack
// set/setDate/setTime need refactoring to have single concerns
// (set: set the value; setDate/setTime rename to renderDate/renderTime
// and deal with updating the view only).
// For now this allows us to set the default time using the same quantize
// rules as setting the date explicitly. Setting this.value meets setTime|Date's
// expectation that we have a value, and `0` guarantees that we will detect
this.value = moment(0);
this.setDate(this.options.default);
this.setTime(this.options.default);
} else {
this.setDate(this.value);
this.setTime(this.value);
}
要
if (!this.value) {
// TODO hack
// set/setDate/setTime need refactoring to have single concerns
// (set: set the value; setDate/setTime rename to renderDate/renderTime
// and deal with updating the view only).
// For now this allows us to set the default time using the same quantize
// rules as setting the date explicitly. Setting this.value meets setTime|Date's
// expectation that we have a value, and `0` guarantees that we will detect
this.value = moment(0);
this.setDate("12/12/1992");
this.setTime(this.options.default);
} else {
this.setDate(this.value);
this.setTime(this.value);
}
向我们展示您为此编写的代码。 – gaganshera
代码冗长,我怎么上传它。 –
只是你调用/初始化日期选择器的代码部分 – gaganshera