syncfusion / ej2-angular-ui-components

Syncfusion Angular UI components library offer more than 50+ cross-browser, responsive, and lightweight angular UI controls for building modern web applications.
https://www.syncfusion.com/angular-ui-components
Other
275 stars 114 forks source link

Change the label of 'Start Date' and 'End Date' #33

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello Team,

I'm using the date-range picker and I want to change the label of 'Start Date' and 'End Date' to 'Send on' and 'Deliver by' respectively. So please guide me how I can do this?

Your quick response is much appreciated.

Thanks in advance.

BerlyChristopher commented 5 years ago

Hi Anoopyadav,

Greetings from Syncfusion.

We can customize the available labels in the DateRangePicker popup through “L10n.load” method based on the required locale. As per your requirement, we have customized the startDate and endDate label to “Send on” and “Deliver by” based on the “en-US” culture. Please refer the below code example.

[app.component.html]

<ejs-daterangepicker></ejs-daterangepicker>

[app.component.ts]

import { Component, ViewEncapsulation, Inject } from '@angular/core';
import { L10n } from '@syncfusion/ej2-base';
@Component({
  selector: 'app-root',
  styleUrls: ['app.component.css'],
  templateUrl: 'app.component.html',
  encapsulation: ViewEncapsulation.None
})
export class AppComponent {
  ngOnInit(): void {
    L10n.load({
      'en-US': {
        'daterangepicker': {
          startLabel: 'Send on',
          endLabel: 'Deliver by'
        }
      }
    });
  }
}

Please find the sample from the below link.

Sample Link: https://stackblitz.com/edit/angular-krlmmu-e3hx4s?file=app.component.html

We have showcased this customization in the below UG documentation link.

UG Link: https://ej2.syncfusion.com/angular/documentation/daterangepicker/globalization/

Regards, Berly B.C

ghost commented 5 years ago

Thanks, Berly, It's working.