在代碼替換材料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