[MAGNOLIA-4497] Date Control: timeFormat and jsTimeFormat not working Created: 30/Jul/12  Updated: 14/Jan/14  Resolved: 05/Apr/13

Status: Closed
Project: Magnolia
Component/s: gui
Affects Version/s: 4.4.6
Fix Version/s: 4.4.11, 4.5.9

Type: Bug Priority: Neutral
Reporter: Richard Unger Assignee: Milan Divilek
Resolution: Fixed Votes: 0
Labels: datecontrol, dialogs, gui
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Magnolia EE 4.4.8


Issue Links:
Cloners
is cloned by MGNLADMLEG-6 CLONE - Date Control: timeFormat and ... Closed
causality
is causing MAGNOLIA-5111 Time does not get saved, because date... Closed
relation
is related to MAGNOLIA-4502 dateFormat and timeFormat doesn't wor... 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)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Since upgrading to Magnolia 4.4.6 we are experiencing the following problem:

We have a customer requirement that dates in certain dialogs must be input with times, but without seconds.
We set the timeFormat and jsTimeFormat to "HH:mm" and "%k:%M" respectively.
When the dialog opens, times are displayed in the correct format (no seconds).

The problems is when saving the dialog:
If the seconds are not present in the input, saving the values fails with an exception, and the error is not reported back to the user.
The dialog is just closed, without the values for the dates being saved, even though other fields in the dialog are saved.



 Comments   
Comment by Richard Unger [ 30/Jul/12 ]

The exception generated is:

ERROR info.magnolia.module.admininterface.SaveHandlerImpl 30.07.2012 12:05:40 – Could not update date value of node:/lmat/kalender/umwelt/xxx/veranstaltung of property:enddate
java.text.ParseException: Unparseable date: "2012-08-02 23:54"
at java.text.DateFormat.parse(DateFormat.java:337)
at info.magnolia.cms.util.DateUtil.getUTCCalendarFromDialogString(DateUtil.java:214)
at info.magnolia.module.admininterface.SaveHandlerImpl.processDate(SaveHandlerImpl.java:370)
at info.magnolia.module.admininterface.SaveHandlerImpl.processSaveInfo(SaveHandlerImpl.java:353)
at info.magnolia.module.admininterface.SaveHandlerImpl.save(SaveHandlerImpl.java:223)
at info.magnolia.module.admininterface.DialogMVCHandler.onSave(DialogMVCHandler.java:334)
at info.magnolia.module.admininterface.DialogMVCHandler.save(DialogMVCHandler.java:229)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at info.magnolia.cms.servlets.MVCServletHandlerImpl.execute(MVCServletHandlerImpl.java:118)

Comment by Richard Unger [ 30/Jul/12 ]

Following the code for saving, it seems obvious that it can't work:

SaveHandlerImpl.processDate() simply uses DateUtil.getUTCCalendarFromDialogString()

This method doesn't take the custom date or time format into account in any way, insisting on one of 2 standardized formats (with or without time).

Comment by Richard Unger [ 02/Aug/12 ]

Seems we're not the only ones with this issue:

http://jira.magnolia-cms.com/browse/MAGNOLIA-4502

Comment by Milan Divilek [ 03/Aug/12 ]

Thanks for reporting issue Richard. It should be fixed for the next version.

Comment by Milan Divilek [ 03/Aug/12 ]

Before resolving this issue in 4.5.x branch, it's necessary solved issue MAGNOLIA-4502

Generated at Mon Feb 12 03:56:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.