mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
Fix DateRange UI did not fill in start date properly
This commit is contained in:
parent
d3eed5b738
commit
60e4e17fad
@ -3,9 +3,7 @@ import {FormControlMixin} from "@lion/form-core";
|
||||
import {classMap, css, html, ifDefined, LitElement, TemplateResult} from "@lion/core";
|
||||
import shoelace from "../Styles/shoelace";
|
||||
import {dateStyles} from "./DateStyles";
|
||||
import flatpickr from "flatpickr";
|
||||
import {default as rangePlugin} from "flatpickr/dist/plugins/rangePlugin";
|
||||
import {Et2Date, formatDate, parseDate} from "./Et2Date";
|
||||
import {formatDate, parseDate} from "./Et2Date";
|
||||
import {egw} from "../../jsapi/egw_global";
|
||||
|
||||
/**
|
||||
@ -55,30 +53,6 @@ export class Et2DateRange extends Et2InputWidget(FormControlMixin(LitElement))
|
||||
super();
|
||||
}
|
||||
|
||||
getUpdateComplete() {
|
||||
const p = super.getUpdateComplete();
|
||||
if(!this.relative)
|
||||
{
|
||||
p.then(() => this.setupFlatpickr());
|
||||
}
|
||||
return p;
|
||||
}
|
||||
protected setupFlatpickr()
|
||||
{
|
||||
if(!this.fromElement || !this.fromElement._inputElement) return;
|
||||
|
||||
this.fromElement._instance = flatpickr((<Et2Date>this.fromElement).findInputField(), {
|
||||
...(<Et2Date>this.fromElement).getOptions(),
|
||||
...{
|
||||
plugins: [
|
||||
rangePlugin({
|
||||
input: this.toElement
|
||||
})
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const hasLabel = this.label ? true : false
|
||||
|
Loading…
Reference in New Issue
Block a user