History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-2631
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Jeroen Gordijn
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Grails

FormatName is not correctly handled in <g:formatDate formatName="...." />

Created: 12/Mar/08 10:57 AM   Updated: 12/Mar/08 10:57 AM
Component/s: TagLib
Affects Version/s: 1.0.1
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
I looked at the formatDate code to find out that it is possible to put the format string in my "messages.properties" file. When the given key (by formatName) does not exist, a TagError should be thrown. However, this does not happen.

The existence of the formatName key is checked with:

format = message(code:formatName)
if(!format) throwTagError("Attribute [formatName] of Tag [formatDate] specifies a format key [$formatName] that does not exist within a message bundle!")

IMHO this should be:

format = message(code:formatName, default: "")
if(!format) throwTagError("Attribute [formatName] of Tag [formatDate] specifies a format key [$formatName] that does not exist within a message bundle!")

Sorry, I don't know how to submit this as a patch.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.