-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Dynamic formating
PostPosted: Tue Dec 07, 2004 6:02 pm 
Newbie

Joined: Fri Dec 03, 2004 4:41 pm
Posts: 15
We have a case where users can choose their own date format. In a number of cases the classes passing the date objects pass as strings, not date objects. Formatting is occuring at the persistence tier, not the presentation tier.

Is there a way to pass a different format string for each different get or find function call?


Top
 Profile  
 
 Post subject: Re: Dynamic formating
PostPosted: Wed Dec 08, 2004 4:09 am 
Senior
Senior

Joined: Sat Jul 17, 2004 5:16 pm
Posts: 143
mardigrasboy wrote:
We have a case where users can choose their own date format. In a number of cases the classes passing the date objects pass as strings, not date objects. Formatting is occuring at the persistence tier, not the presentation tier.

Is there a way to pass a different format string for each different get or find function call?


Use a Date type (not a String type), and format it when you get it out of the object.

Chris


Top
 Profile  
 
 Post subject: Dynamic
PostPosted: Wed Dec 08, 2004 12:46 pm 
Newbie

Joined: Fri Dec 03, 2004 4:41 pm
Posts: 15
Yes, but we have cases where you may have 4 dates objects. Seems silly to do that for each data member vs a nice dynamic change.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 4:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
Formatting is occuring at the persistence tier, not the presentation tier


Uggh! Have fun


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 5:57 pm 
Senior
Senior

Joined: Sat Jul 17, 2004 5:16 pm
Posts: 143
Yeah, this is a tough one. Write a utility method that takes a string date, and a format, detects its existing format, and reformats it... Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.