This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit ad8209f01691678c22ec80ba01c746372c240898 Author: Kevin Morin <morin@codelutin.com> Date: Tue Sep 12 10:31:16 2017 +0200 verification de la validité des heures et minutes --- .../main/web/tag/components/time-picker.tag.html | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/components/time-picker.tag.html b/pollen-ui-riot-js/src/main/web/tag/components/time-picker.tag.html index 59f28b45..5e6a6371 100644 --- a/pollen-ui-riot-js/src/main/web/tag/components/time-picker.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/components/time-picker.tag.html @@ -15,6 +15,7 @@ type="number" max="23" min="0" + required value="{opts.time.time ? opts.time.time.format('HH') : moment().format('HH')}" onchange="{hourChanged}"/> <span class="colon">:</span> @@ -23,6 +24,7 @@ type="number" max="59" min="0" + required value="{opts.time.time ? opts.time.time.format('mm') : moment().format('mm')}" onchange="{minuteChanged}"/> </div> @@ -67,19 +69,25 @@ this.update(); }); - this.minuteChanged = (e) => { + this.hourChanged = (e) => { this.initTime(); - this.opts.time.time = this.opts.time.time.minutes(this.refs.minuteInput.value); - if (this.opts.onchange) { - this.opts.onchange(); + let hour = parseInt(this.refs.hourInput.value); + if (!isNaN(hour)) { + this.opts.time.time.hours(hour); + if (this.opts.onchange) { + this.opts.onchange(); + } } }; - this.hourChanged = (e) => { + this.minuteChanged = (e) => { this.initTime(); - this.opts.time.time = this.opts.time.time.hours(this.refs.hourInput.value); - if (this.opts.onchange) { - this.opts.onchange(); + let minute = parseInt(this.refs.minuteInput.value); + if (!isNaN(minute)) { + this.opts.time.time.minutes(minute); + if (this.opts.onchange) { + this.opts.onchange(); + } } }; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.