Open vadimt2 opened 3 years ago
I was not able to reproduce the problem, can you describe it in detail?
Sure. Set the :shortcuts="shortcuts"
data() ....
shortcuts: this.setShortcuts(),
method....
setShortcuts() {
debugger;
const shortcuts = [
{
text: this.$t('Today'),
value: new Date(),
},
{
text: this.$t('LastInputDate'),
onClick: (picker) => {
let lastDate = GanttDataAnalizer.getLastInputDate();
if (!lastDate) lastDate = (this as any).lastScheduleDate;
this.currentScheduleDate = this.lastScheduleDate!;
// // DateHelper.getDateWithoutTime(lastDate as Date)
this.onScheduleDatepickerChanged(DateHelper.getDateWithoutTime(lastDate as Date));
},
},
];
return shortcuts;
},
The language will be in English. Then try to change the language to a different language.
shortcuts will stay in English they wouldn't change. It will change in the method but not in the UI.
Just create a select box with eng and ru options. when you are changing an option, the language of date picker on the right side should change. - I'm talking about Today and Last input date For testing you can just pass an array
const array = ['MIKE','DJ']; // for the second time you
setShortcuts(array) {
debugger;
const shortcuts = [
{
text: array[0]
value: new Date(),
},
{
text: array[1],
onClick: (picker) => {
let lastDate = GanttDataAnalizer.getLastInputDate();
if (!lastDate) lastDate = (this as any).lastScheduleDate;
this.currentScheduleDate = this.lastScheduleDate!;
// // DateHelper.getDateWithoutTime(lastDate as Date)
this.onScheduleDatepickerChanged(DateHelper.getDateWithoutTime(lastDate as Date));
},
},
];
return shortcuts;
},
Vue file
ts
// I have tried to do it with a computed property as well and it doesn't work datepicker doesn't change the language. How can I change shortcuts language when someone changes the language?