mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 04:41:41 +02: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()
|
disconnectedCallback()
|
||||||
{
|
{
|
||||||
super.disconnectedCallback();
|
super.disconnectedCallback();
|
||||||
this._inputNode.removeEventListener('change', this._onChange);
|
this._inputNode?.removeEventListener('change', this._onChange);
|
||||||
this._inputNode.removeEventListener("input", this._handleInputChange);
|
this._inputNode?.removeEventListener("input", this._handleInputChange);
|
||||||
this.destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,11 +433,7 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl
|
|||||||
new scrollPlugin(),
|
new scrollPlugin(),
|
||||||
|
|
||||||
// Add "today" button
|
// Add "today" button
|
||||||
// @ts-ignore TypeScript can't find ShortcutButtonsPlugin, but rollup does
|
this._buttonPlugin()
|
||||||
ShortcutButtonsPlugin({
|
|
||||||
button: [{label: this.egw().lang("Today")}],
|
|
||||||
onClick: this._handleShortcutButtonClick
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Listen for flatpickr change so we can update internal value, needed for validation
|
// 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)
|
set value(value)
|
||||||
{
|
{
|
||||||
if(!value || value == 0 || value == "0")
|
if(!value || value == 0 || value == "0")
|
||||||
|
@ -66,6 +66,19 @@ export class Et2DateTime extends Et2Date
|
|||||||
|
|
||||||
return options;
|
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
|
// @ts-ignore TypeScript is not recognizing that Et2DateTime is a LitElement
|
||||||
|
Loading…
x
Reference in New Issue
Block a user