Home > Blockchain >  How to Capitalize the First Letter of the Kendo-DatePicker format in Angular?
How to Capitalize the First Letter of the Kendo-DatePicker format in Angular?

Time:05-16

I have a kendo-datepicker and it's always displaying the format in the field like following. enter image description here

But I want to customize this as Month/Day/Year. Capitalize the first letter. Is it possible to customize like this.

.html

<form [formGroup]="myForm">

    <label for="address" >Date</label>
    
     <div >
    
         <kendo-datepicker formControlName="startingDate" format="MM/dd/yyyy">
         </kendo-datepicker>
    
      </div>
 </form>

.ts

myForm: FormGroup = new FormGroup({
    startingDate: new FormControl(""),
  });

CodePudding user response:

I would override css for date input. Something like this:

.k-dateinput > .k-input-inner {
    text-transform: capitalize;
}

Working example: Capitalize date format in form group

CodePudding user response:

It's fixed by overriding the k-input CSS class.

 :host::ng-deep .k-input {
        text-transform: capitalize;
      }
  • Related