mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Et2Date: change "Today" button label to "Now" for widgets with time (Et2DateTime, Et2Timeonly, etc.)
This commit is contained in:
parent
2cb826e268
commit
dcc6d1eb83
@ -374,8 +374,8 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl
|
||||
disconnectedCallback()
|
||||
{
|
||||
super.disconnectedCallback();
|
||||
this._inputNode.removeEventListener('change', this._onChange);
|
||||
this._inputNode.removeEventListener("input", this._handleInputChange);
|
||||
this._inputNode?.removeEventListener('change', this._onChange);
|
||||
this._inputNode?.removeEventListener("input", this._handleInputChange);
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
@ -433,11 +433,7 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl
|
||||
new scrollPlugin(),
|
||||
|
||||
// Add "today" button
|
||||
// @ts-ignore TypeScript can't find ShortcutButtonsPlugin, but rollup does
|
||||
ShortcutButtonsPlugin({
|
||||
button: [{label: this.egw().lang("Today")}],
|
||||
onClick: this._handleShortcutButtonClick
|
||||
})
|
||||
this._buttonPlugin()
|
||||
];
|
||||
|
||||
// Listen for flatpickr change so we can update internal value, needed for validation
|
||||
@ -477,6 +473,19 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Add "today" button below calendar
|
||||
* @protected
|
||||
*/
|
||||
protected _buttonPlugin()
|
||||
{
|
||||
// @ts-ignore TypeScript can't find ShortcutButtonsPlugin, but rollup does
|
||||
return ShortcutButtonsPlugin({
|
||||
button: [{label: this.egw().lang("Today")}],
|
||||
onClick: this._handleShortcutButtonClick
|
||||
})
|
||||
}
|
||||
|
||||
set value(value)
|
||||
{
|
||||
if(!value || value == 0 || value == "0")
|
||||
|
@ -66,6 +66,19 @@ export class Et2DateTime extends Et2Date
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add "today" button below calendar
|
||||
* @protected
|
||||
*/
|
||||
protected _buttonPlugin()
|
||||
{
|
||||
// @ts-ignore TypeScript can't find ShortcutButtonsPlugin, but rollup does
|
||||
return ShortcutButtonsPlugin({
|
||||
button: [{label: this.egw().lang("Now")}],
|
||||
onClick: this._handleShortcutButtonClick
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-ignore TypeScript is not recognizing that Et2DateTime is a LitElement
|
||||
|
Loading…
Reference in New Issue
Block a user