[Lift] Re: How to localize date format in MappedDate

2009-08-18 Thread David Pollak
You can control this via the newly added LiftRules:

/**
* A function to format a Date... can be replaced by a function that is
user-specific
*/
  var formatDate: Date = String = date = date match {case null =
LiftRules.formatDate(new Date(0L)) case s = toInternetDate(s)}

/**
* A function that parses a String into a Date... can be replaced by
something that's user-specific
*/
  var parseDate: String = Box[Date] = str = str match {
case null = Empty
case s = Helpers.toDate(s)
  }

So, you can put in functions that parse and format dates based on the
currently logged in user, etc.

On Tue, Aug 18, 2009 at 6:24 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:


 Hi,

 I'm trying to change the date format used by MappedDate for
 display/input, but the only way I can see that works is to create a new
 class that overrides setFromAny, _toForm  toString.

 It looks like the format for output is hardcoded to
 internetDateFormatter and input can be either
 SimpleDateFormat(/MM/dd) or internetDateFormatter.

 Did I miss something?

 /Jeppe

 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to localize date format in MappedDate

2009-08-18 Thread Jeppe Nejsum Madsen

On Tue, Aug 18, 2009 at 8:58 PM, David
Pollakfeeder.of.the.be...@gmail.com wrote:
 You can control this via the newly added LiftRules:

Sweet, just what the doctor ordered...thanks

/Jeppe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---