[MGNLUI-4235] DateField ignores the configured time format for the default value Created: 30/Jun/17  Updated: 12/Jul/17  Resolved: 07/Jul/17

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.5.5
Fix Version/s: 5.5.6

Type: Bug Priority: Neutral
Reporter: Sang Ngo Huu Assignee: Ngoc Nguyenthanh
Resolution: Fixed Votes: 0
Labels: quickwin
Remaining Estimate: 1h
Time Spent: 1d 3h
Original Estimate: 1.5d

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Sprint: Saigon 103
Story Points: 3

 Description   

It is easy to reproduce:
Configure defaultValue for DateField with time enabled

fields:
    time: true
    defaultValue: 2017-10-31 12:30

The field displays 2017-10-31 00:00.

Expected: Display as configured: 2017-10-31 12:30

Investigate point:

info.magnolia.ui.vaadin.integration.jcr.DefaultPropertyUtil#createTypedValue(java.lang.Class<?>, java.lang.String)

return new SimpleDateFormat(DateUtil.YYYY_MM_DD).parse(defaultValue);
=> it ignores the configured time format

Generated at Mon Feb 12 09:14:38 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.