You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The picker manages multiple dates out of the box, but set them as a concatenated string in a single input.
It would be great, espacially for range pickers, to be able to set multiple inputs. The way to do it, through a new input fields option, could be something like:
New option (to be parsed in optionProcessors function?) this.optionsStore.input = undefined | <String> | <DOMElement> | Array <Strings> | Array <DOMElements>;
Initialize Inputs function (in Tempus Dominus class) _initializeInput() { ... if (this.optionsStore.input instanceof Array) { const inputs = this.optionsStore.input; for (var i = 0; i < inputs.length; i++) { inputs[i].dataset.tdInputIndex = i; inputs[i].addEventListener('change', this._inputChangeEvent); } } ... }
Input Change Event function (in Tempus Dominus class) this._inputChangeEvent = (event) => { ... if (this.optionsStore.input instanceof Array) { const inputs = this.optionsStore.input; for (var i = 0; i < inputs.length; i++) { this.dates.setFromInput(inputs[i].value, inputs[i].dataset.tdInputIndex); } } ... }
It's not tested at all and will probably have a lot of other consequences (how are multipleDates and rangeSelection options linked together?), but might be a nice option to have.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The picker manages multiple dates out of the box, but set them as a concatenated string in a single input.
It would be great, espacially for range pickers, to be able to set multiple inputs. The way to do it, through a new input fields option, could be something like:
New option (to be parsed in optionProcessors function?)
this.optionsStore.input = undefined | <String> | <DOMElement> | Array <Strings> | Array <DOMElements>;
Initialize Inputs function (in Tempus Dominus class)
_initializeInput() {
...
if (this.optionsStore.input instanceof Array) {
const inputs = this.optionsStore.input;
for (var i = 0; i < inputs.length; i++) {
inputs[i].dataset.tdInputIndex = i;
inputs[i].addEventListener('change', this._inputChangeEvent);
}
}
...
}
Input Change Event function (in Tempus Dominus class)
this._inputChangeEvent = (event) => {
...
if (this.optionsStore.input instanceof Array) {
const inputs = this.optionsStore.input;
for (var i = 0; i < inputs.length; i++) {
this.dates.setFromInput(inputs[i].value, inputs[i].dataset.tdInputIndex);
}
}
...
}
It's not tested at all and will probably have a lot of other consequences (how are multipleDates and rangeSelection options linked together?), but might be a nice option to have.
Thank you for your consideration.
Beta Was this translation helpful? Give feedback.
All reactions