【发布时间】:2017-07-20 21:54:03
【问题描述】:
我正在为 Angular 日期选择器使用 KendoUI;为了定义今天的日期,我使用:
public value: Date = new Date();
如果我想将日期显示为今天的日期,减去 180 天,我该怎么办?
这在 typescript/angular 4 等中。就像在我的 component.ts 文件中一样:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-record-filter-from-date',
template: `
<div class="form-group">
<label>From Date:</label>
<kendo-datepicker class="k-widget k-datepicker k-header crowd-control k-input" style="width: 100%;"
[(ngModel)]="value"
[format]="'dd-MMM-yyyy'"
#dateModel="ngModel"
></kendo-datepicker>
</div>
`,
styleUrls: ['./record-filter-from-date.component.css']
})
export class RecordFilterFromDateComponent implements OnInit {
public value: Date = new Date();
constructor() {
}
ngOnInit() {
}
}
【问题讨论】:
标签: angular kendo-ui kendo-ui-angular2