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 12c4b03191538ba1ce27c08d92358fda5b75d926 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Mar 20 16:42:38 2017 +0100 correction des date et time picker pour l'initialisation et modification des valeurs pour la cas où le navigateur gére ces types d'input --- .../src/main/web/tag/components/date-picker.tag.html | 14 +++++++++++--- .../src/main/web/tag/components/time-picker.tag.html | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/components/date-picker.tag.html b/pollen-ui-riot-js/src/main/web/tag/components/date-picker.tag.html index e16d174..b920482 100644 --- a/pollen-ui-riot-js/src/main/web/tag/components/date-picker.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/components/date-picker.tag.html @@ -1,6 +1,10 @@ <date-picker> - <input type="date" class="calendar-field" onclick="{open}" value="{opts.date.date.format(format)}" readonly="{!session.dateInputSupported}" /> - + <input type="date" + class="calendar-field" + onclick="{open}" + value={opts.date.date.format(session.dateInputSupported ? "YYYY-MM-DD" : format)} + readonly="{!session.dateInputSupported}" + onchange={onDateChange}/> <div class="c-calendar c-calendar--higher" if="{opts.date.isVisible && !session.dateInputSupported}"> <button type="button" class="c-calendar__control" disabled="{ opts.date.min && opts.date.min.isSame(opts.date.date, 'year') }" onclick="{ prevYear }">‹</button> <div class="c-calendar__header">{ opts.date.date.format(yearFormat) }</div> @@ -28,7 +32,7 @@ <script type="es6"> this.session = require("../../js/Session"); - + this.format = "LL"; this.moment = require("moment"); this.moment.locale(this.session.locale); @@ -174,6 +178,10 @@ this.opts.date.date = this.opts.date.date.add(1, "month"); }; + this.onDateChange = (e) => { + this.opts.date.date = toMoment(e.currentTarget.valueAsNumber); + }; + </script> <style scoped> 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 188b84c..9c15f1c 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 @@ -1,6 +1,10 @@ <time-picker> - <input type="time" class="calendar-field" onclick="{open}" value="{opts.time.time.format('LT')}" readonly="{!session.timeInputSupported}" /> - + <input type="time" + class="calendar-field" + onclick="{open}" + value="{opts.time.time.format('LT')}" + readonly="{!session.timeInputSupported}" + onblur={onTimeChange}/> <div class="c-calendar c-calendar--higher" if="{opts.time.isVisible && !session.timeInputSupported}"> <div class="time"> @@ -99,6 +103,12 @@ this.nextMinute = () => { this.opts.time.time = this.opts.time.time.add(1, "minute"); }; + + this.onTimeChange = e => { + var time = this.moment(e.currentTarget.value, "HH:mm"); + this.opts.time.time.set({hour: time.hour(), minute: time.minute()}); + }; + </script> <style scoped> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.