• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Format a date represented as a String to another String representation

 
Fredrik Larsback
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I format a date string to a string with another format with JSF?

E.g.
Format "20100224091007.000000Z" to "2010-02-24 09:10:07"

Regards
/Fredrik
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you expecting JSF to do? Your example is just free-floating data without any context. You're describing a process that can be done without JSF or even any web application at all.
 
Fredrik Larsback
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:What are you expecting JSF to do? Your example is just free-floating data without any context. You're describing a process that can be done without JSF or even any web application at all.


I have a Seam application which reads a date as a string from a backing bean which is packaged in a jar which can't be modified. I'd like to know if there is way to format this date-String to another format in my .xhtml page through some tag library like <f:convertDateTime> or should a write my own facelet tag library to achive this?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that's within the capabilities of the JSF Converter architecture. A Converter basically has 2 methods in it (inbound and outbound conversions), and is typically registered in the faces-config file, where you bind the actual converter class to a logical converter name for use in converter tags.
 
Fredrik Larsback
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:I believe that's within the capabilities of the JSF Converter architecture. A Converter basically has 2 methods in it (inbound and outbound conversions), and is typically registered in the faces-config file, where you bind the actual converter class to a logical converter name for use in converter tags.


Ok, thanks. Then I'll write a converter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic