owsolutions / amazing-time-picker

Timepicker (Clock Picker) for Angular 2, Angular 4 and Angular 5, Angular 6, Angular 7 - Compatible with Angular Material
138 stars 76 forks source link

how can I change the text in the "OK" and "cancel" buttons #134

Open manuelQuiroz opened 4 years ago

manuelQuiroz commented 4 years ago

I need to change the descriptive text of the "OK" and "cancel" buttons. I tried placing the changes in the open method configuration object but I didn't get it.

open( ) {
let configTimer = {
    time: this.mytimerVar,
    start: '15:30',
      end: '23:30',
    label: {  // this concept need add 
      ok: "Aceptar",
      cancel: "Cancelar"
    },
    arrowStyle: {
      background:  '#3bb0c9' ,
      color: 'white'
    }
  }
    const amazingTimePicker = this._timePickr.open(configTimer);
    amazingTimePicker.afterClose().subscribe(time => {

    });
  }
Qvadis commented 4 years ago

I found the solution.

You have to pass labels inside a preference object like this:

let configTimer = {
  time: this.mytimerVar,
  start: '15:30',
    end: '23:30',
  preferences: { 
       labels: { 
             ok: "Aceptar",
             cancel: "Cancelar"
       },
  }
  arrowStyle: {
    background:  '#3bb0c9' ,
    color: 'white'
  }
}