我正在使用ngx-daterangepicker-material来挑选日期。我想知道如何在控制台中查看提货日期?
<input type="text" ngxDaterangepickerMd [(ngModel)]="selected" (change)="getClaims()" [locale]="{applyLabel: 'ok', format: 'DD-MMMM-YY'}" class="form-control"/>
if(this.selected){
console.log(this.selected); // need to show date in DD-MMMM-YY Format
}我需要在控制台中显示日期(格式为DD-MMMM-YY)

发布于 2019-07-24 17:52:21
正如您所看到的,您的startDate和endDate都属于Moment类型
因此,您可以根据需要轻松地格式化日期
if(this.selected){
console.log(this.selected.endDate.format("DD-MMMM-YY"); // need to show date in DD-MMMM-YY Format
}您可以对startDate执行相同的操作
https://stackoverflow.com/questions/57179257
复制相似问题