-
1. Re: Date formatting in EL expression
damianharvey Dec 6, 2007 9:26 AM (in response to chawax)Have you looked at s:convertDateTime?
Cheers,
Damian. -
2. Re: Date formatting in EL expression
chawax Dec 6, 2007 9:37 AM (in response to chawax)Yes, I know it. But I don't think it can be used for my problem.
I should have shown an example of the way I need to use it, it would have bean clearer. My EL expression is defined a resource file and then used with the messages built-in component :<h:outputText value="#{messages['el.demandeAbsence.resume']}" />
With my resource file like this :el.demandeAbsence.resume=Du #{da.lignes[0].dateDebut} au #{da.lignes[0].dateFin}
So I don't see how I could use <s:convertDateTime> there. -
3. Re: Date formatting in EL expression
chawax Dec 7, 2007 4:04 AM (in response to chawax)I heard about EL functions ... Could it be an answer to my problem ? If so, are there EL functions that can format dates ? And how should I use them ?
-
4. Re: Date formatting in EL expression
pmuir Dec 7, 2007 6:32 AM (in response to chawax)EL functions are super easy to write (a bit harder to wire, but there are tutorials on the net) and you could easily write
#{my:formatDate(date, 'HH:MM TZ')}
or similar for use inline in EL. -
5. Re: Date formatting in EL expression
chawax Dec 7, 2007 9:07 AM (in response to chawax)Well, I could not found any tutorial about this on the net. It would be very kind from you to give me a link if you have one ;)
I just found tutorials for custom EL functions used in JSP via taglibs. But my app uses facelets, not JSP. Moreover the EL expression to evaluate is in a resource bundle, which is a Seam EL enhancement for what I understood. I had a look on the way this has been done for s:hasRole and s:hasPermission built-in Seam EL functions, but it looks like this has been hard-coded in org.jboss.seam.el.SeamFunctionMapper class. Do you know an easy way to add my own EL functions to this Seam function mapper, in a configuration file for example ? -
6. Re: Date formatting in EL expression
pmuir Dec 7, 2007 9:14 AM (in response to chawax)You're right, it will be hard to plug this in without replicating a lot of Seam code.
Open a JIRA feature request to make this extensible. -
7. Re: Date formatting in EL expression
chawax Dec 7, 2007 9:33 AM (in response to chawax)Thanks for your answer, a negative answer is always better than no answer at all ! As you suggest, I opened a JIRA for this : http://jira.jboss.org/jira/browse/JBSEAM-2356
For the moment, I think I can workaround this problem using a Seam component. -
8. Re: Date formatting in EL expression
mars1412 Dec 11, 2007 11:28 AM (in response to chawax)if it was for dates in the properties fieles only, then this is the same issue:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100761