<nz-form-item>
<nz-form-label nzRequired nzSpan="4">完成日期</nz-form-label>
<nz-form-control nzSpan="15">
<nz-date-picker nzFormat="yyyy-MM-dd" formControlName="completedAt" (ngModelChange)='dateChange($event)' [nzLocale]='locale'></nz-date-picker>
<nz-form-explain *ngIf="isInvalid('completedAt')">请选择完成日期</nz-form-explain>
</nz-form-control>
</nz-form-item>
add = this.form.group({
vehicleId: [null, [Validators.required]],
meter: [null, [Validators.required]],
completedAt: [null, [Validators.required]],
vendorId: [null],
reference: [null],
});
dateChange(value){ this.date=value;
console.log(moment(this.add.value.completedAt).format('YYYY-MM-DD') );
console.log(+this.add.value.completedAt)
}我想问的是能不用自己转换格式或者用monent.js 通过配置直接让传给后端的是字符串格式的时间么
添加回答
举报
0/150
提交
取消