QeelwaEtech / omnifaces

Automatically exported from code.google.com/p/omnifaces
0 stars 1 forks source link

Date name swap key and value in return map #145

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
date name retrieval functions with return type of Map like "of:getDaysOfWeek()" 
should use the Integer value as the key.

How else should a simple day name be retrieved?

of:getDaysOfWeek()[1] is not working since a Map<String, Integer> is returned 
instead of Map<Integer, String>.

If my data object "bean" has a day numeric field there is no way to retrieve 
the name of the day.

So I would still need a new function to localize a single day which makes 
"of:getDaysOfWeek" obsolete (in combination with "of:createIntegerArray" for 
example).

The only possible usage of "of:getDaysOfWeek()" is within a "ui:repeat" or 
"f:selectitems" to display all values.

Original issue reported on code.google.com by releases...@googlemail.com on 24 Feb 2013 at 3:28

GoogleCodeExporter commented 9 years ago
They're initially also designed for usage in <f:selectItems>.

I've added of:getMonth(Integer), of:getShortMonth(Integer),
of:getDayOfWeek(Integer) and of:getShortDayOfWeek(Integer): 
http://code.google.com/p/omnifaces/source/detail?r=a12a51e6a0effd043cedfebbd3c7a
90c9797dc34

You can find attached the current snapshot: 

Original comment by balusc on 25 Feb 2013 at 2:09

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for that quick fix, already created my own function but next time i 
should wait for your update^^

Original comment by releases...@googlemail.com on 25 Feb 2013 at 12:42