Hi,
I not found in properties of Studio something for first day of the week for this component so was necessary to rewrite to change from Sunday to Monday the first day of the week, my code may be help someone:
@ViewComponent
private TypedDatePicker<LocalDate> germEvalDateField;
@ViewComponent
private TypedDatePicker<LocalDate> germStartDateField;
@Subscribe
public void onInit(final InitEvent event) {
final Locale locale = currentAuthentication.getLocale();
// check if user choose Română for display language
if (locale.getDisplayLanguage().equals("română")) {
// set the date piker in Romanian
germStartDateField.setI18n(romanianI18nDatePicker());
germEvalDateField.setI18n(romanianI18nDatePicker());
}
// call some methods
initManualTooltip();
checkFields();
}
// more code lines
// method for create date picker in Romanian language
protected DatePicker.DatePickerI18n romanianI18nDatePicker() {
DatePicker.DatePickerI18n romanianI18n = new DatePicker.DatePickerI18n();
// set Monday as first day of the week
romanianI18n.setFirstDayOfWeek(1);
// set the list with the months
romanianI18n.setMonthNames(
List.of("Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie",
"Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie")
);
// set the list with long name of week days
romanianI18n.setWeekdays(
List.of("Duminică", "Luni", "Marți", "Miercuri", "Joi", "Vineri", "Sâmbătă")
);
// set the list with short name of week days
romanianI18n.setWeekdaysShort(
List.of("dum.", "lun.", "mar.", "mie.", "joi", "vin.", "sâm.")
);
// translate Today
romanianI18n.setToday("Astăzi");
// translate Cancel
romanianI18n.setCancel("Anulare");
// set date format
romanianI18n.setDateFormat("dd/MM/yyyy");
// return the date picker for Romanian language
return romanianI18n;
}
Exist another easy solution for this?