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 50e107601197cda5030881523ad8bf41acbc305c Author: Kevin Morin <morin@codelutin.com> Date: Thu May 18 15:52:02 2017 +0200 correction de l'édition des dates dans le sondage --- pollen-ui-riot-js/src/main/web/js/UIHelper.js | 8 +++++++- .../src/main/web/tag/poll/Settings.tag.html | 16 ++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/js/UIHelper.js b/pollen-ui-riot-js/src/main/web/js/UIHelper.js index c220b9e..30c41ff 100644 --- a/pollen-ui-riot-js/src/main/web/js/UIHelper.js +++ b/pollen-ui-riot-js/src/main/web/js/UIHelper.js @@ -47,5 +47,11 @@ module.exports = { return ""; }, - bus: require("./PollenBus.js") + formatDateForInput(date) { + return this.formatDate(date, "YYYY-MM-DDTHH:mm"); + }, + + bus: require("./PollenBus.js"), + + DATETIME_INPUT_PATTERN: "[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}" }; diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html index 8c35397..fbd7481 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html @@ -110,7 +110,8 @@ class="c-field" disabled={form.hasVotes} value={form.model.beginChoiceDate} - type="datetime-local"> + type="datetime-local" + pattern={DATETIME_INPUT_PATTERN}> </div> <div class="o-form-element"> <label class="c-label" for="endChoiceDate"> @@ -122,7 +123,8 @@ class="c-field" disabled={form.hasVotes} value={form.model.endChoiceDate} - type="datetime-local"> + type="datetime-local" + pattern={DATETIME_INPUT_PATTERN}> </div> </div> <div show="{canLimitNumberOfChoices}" class="o-form-element"> @@ -183,10 +185,11 @@ <input ref="beginDate" name="beginDate" id="beginDate" - disabled={form.hasVotes} - value={form.model.beginDate} + disabled={!form.hasVotes} + value={formatDateForInput(form.model.beginDate)} class="c-field" - type="datetime-local"> + type="datetime-local" + pattern={DATETIME_INPUT_PATTERN}> </div> <div class="o-form-element"> <label class="c-label" for="endDate"> @@ -195,9 +198,10 @@ <input ref="endDate" name="endDate" id="endDate" - value={form.model.endDate} + value={formatDateForInput(form.model.endDate)} class="c-field" type="datetime-local" + pattern={DATETIME_INPUT_PATTERN} onchange="{onEndDateChanged}"> </div> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.