[MGNLUI-5940] Improve DateField implementation Created: 09/Jun/20  Updated: 08/Jul/20  Resolved: 06/Jul/20

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

Type: Improvement Priority: Neutral
Reporter: Adam Siska Assignee: Adam Siska
Resolution: Done Votes: 0
Labels: 62-UI-1
Remaining Estimate: Not Specified
Time Spent: 44m
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLUI-5888 DateField with defaultValue fails on CCE Closed
is related to MGNLUI-5958 defaultValue: now for date field is n... Closed
supersession
supersedes MGNLUI-5958 defaultValue: now for date field is n... Closed
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)
Documentation update required:
Yes
Date of First Response:
Epic Link: UI framework: forms, dialogs, content editing
Sprint: UI FW 5
Story Points: 3

 Description   

Current DateField implementation could be improved in several ways:

  1. it uses Java7 SimpleDateFormat and Date type instead of Java8 DateTimeFormater and Temporal types
  2. DateFieldDefinition contains unwanted logic and as a consequence of this, defaultValue NOW is interpreted as the time of reading definition instead of time of generating field in detail sub app
  3. parsing of default value is locale specific and should be probably be hardcoded to english as docu site don't mention this at all (this last thing is in fact a bug in non-english systems)

https://documentation.magnolia-cms.com/display/DOCS62/Date+field



 Comments   
Comment by Adam Siska [ 30/Jun/20 ]

Docu: imho just replace SimpleDateFormat link with DateTimeFormatter

Comment by Ashraf Khamis [ 08/Jul/20 ]

Replaced SimpleDateFormat with DateTimeFormatter for the dateFormat and timeFormat properties: https://documentation.magnolia-cms.com/display/DOCS62/Date+field.

Examples remain the same. Reviewed by Roman.

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