Open skiedrowski opened 3 years ago
The problem comes from the underlining component that only supports ISO 8601 with only three digits in the decimal fraction place (ms) versus Java that supports up to 9 digits (nanosecond).
As a workaround you can use LocalDateTime.parse("2022-01-03T22:32:52.999587").truncatedTo(ChronoUnit.MILLIS)
.
The workaround works, but it clutters the code with lots of .truncatedTo(MILLIS)
.
It is ok as a workaround, but what about a fix?
Description
It seems impossible to set a
LocalDateTime
with milliseconds != 0 into a TestBenchDateTimePickerElement
.The following code
has no effect (displayed date/time both do not change).
Expected outcome
(with Locale de_DE)
should cause the DatePicker to show "03.01.2022" and TimePicker to show 22:32.
Actual outcome
Neither the DatePicker nor the TimePicker gets updated.
Minimal reproducible example
Given a view with a
DateTimePicker
And a testbench test trying to set 3 differentLocalDateTime
values like that:The last two asserts fail since neither the date nor the time have been updated.
Steps to reproduce
Environment
Browsers Affected
Did not test other browsers.
Side notes
DateTimePickerElement.setDateTime()
and alsoDateTimePicker.setTime()
TimePickerElement.setTime()