Also more flexibility should be coming soon if I'm not mistaken. I think there's a ticket and Derek is planning on working on it.
On Tue, Oct 6, 2009 at 4:59 PM, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote: > > Dirk Louwers <dirk.louw...@stormlantern.nl> writes: > >> Hi, >> >> After having toyed around with Scala and recently Lift for a few weeks >> I have a question. To avoid jumping to conclusions let me first >> explain what I am trying to achieve: >> >> I am not happy with the way MappedDateTime parses strings and formats >> dates by default. I want to be able to change these parsers/formatters >> globally and/or on a per mapper field basis. >> >> Here is what I did: >> >> By looking at the sourcecode I noticed that following MappedDateTime >> ultimately this depends on internetDateFormatter, dateFormatter and >> toInternetDate inside TimeHelpers. Since I don't know how to change >> the dependency of MappedDateTime on TimeHelpers to a subclass of >> TimeHelpers I decided to break the dependency by subclassing >> MappedDateTime and overriding _toForm and setFromAny and have my >> setFromAny call a modified toDate that in turn depends on a custom >> function to parse a string to a date. This function: >> 1) Tries to use a specifically definded DateFormat on the field >> 2) Tries to get a dateformat from a localized bundle >> 3) Falls back to the SHORT date format of the JVM locale. >> >> Here is what I would like to know: >> >> 1) Is there a way to have Lift use a TimeHelpers subclass without >> having to subclass stuff that depends on it? >> 2) Does anyone have suggestions how to improve/invalidate my approach? >> >> Just checking to see if I am on the right path or making this >> needlessly hard. >> Thanks in advance for any response. > > Sounds like you're using 1.0? In 1.1-SNAPSHOT, date/time > parsing/formatting is done in LiftRules.parseDate/formatDate and can be > changed. Not quite per field flexibility though.... > > I think that this is also not locale specific (ie. per request), but > haven't looked too closely at this yet > > /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 -~----------~----~----~----~------~----~------~--~---