Angular中Kendo-DatePicker格式的首字母如何大写?
How to Capitalize the First Letter of the Kendo-DatePicker format in Angular?
我有一个 kendo-datepicker,它总是在字段中显示格式,如下所示。
但我想将其自定义为 Month/Day/Year。首字母大写。可以这样定制吗
.html
<form [formGroup]="myForm">
<label for="address" class="col-sm-2 col-form-label">Date</label>
<div class="col-sm-4">
<kendo-datepicker formControlName="startingDate" format="MM/dd/yyyy">
</kendo-datepicker>
</div>
</form>
.ts
myForm: FormGroup = new FormGroup({
startingDate: new FormControl(""),
});
我会覆盖 css 的日期输入。像这样:
.k-dateinput > .k-input-inner {
text-transform: capitalize;
}
已通过覆盖 k-input CSS class.
修复
:host::ng-deep .k-input {
text-transform: capitalize;
}
我有一个 kendo-datepicker,它总是在字段中显示格式,如下所示。
但我想将其自定义为 Month/Day/Year。首字母大写。可以这样定制吗
.html
<form [formGroup]="myForm">
<label for="address" class="col-sm-2 col-form-label">Date</label>
<div class="col-sm-4">
<kendo-datepicker formControlName="startingDate" format="MM/dd/yyyy">
</kendo-datepicker>
</div>
</form>
.ts
myForm: FormGroup = new FormGroup({
startingDate: new FormControl(""),
});
我会覆盖 css 的日期输入。像这样:
.k-dateinput > .k-input-inner {
text-transform: capitalize;
}
已通过覆盖 k-input CSS class.
修复 :host::ng-deep .k-input {
text-transform: capitalize;
}