• Jérome Perrin's avatar
    renderjs: adjust <input type="datetime-local"> support · 68dad4af
    Jérome Perrin authored
    We were setting the value to a string with seconds like
    `2010-01-01T00:00:00` and all the tests were testing that the value of
    the input element was exactly the same (ie. with seconds), but [the spec]
    mentions that value is:
    
     - A valid date string representing the date.
     - A U+0054 LATIN CAPITAL LETTER T character (T).
     - A valid time string representing the time, expressed as the shortest
      possible string for the given time (e.g. omitting the seconds
      component entirely if the given time is zero seconds past the minute).
    
    The test works fine when running on firefox 68 (the one from testnodes),
    because this version does not implements datetime-local and such field
    behave like text inputs, but when running with a modern browser
    implementing the spec, the test fails because the value from the fields
    `.value` does not have seconds.
    
    While the change to rjs_gadget_erp5_datetimefield_js is not strictly
    necessary, because when setting the value on a datetime-local the value
    will be normalized and having 00 seconds or omitting the seconds is same,
    this is done to keep the test passing on old browsers without support
    for datetime-local fields.
    
    [the spec]: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#concept-datetime-local
    68dad4af
testCRMCreateNewEvent.zpt 3.68 KB