|
Hi,
LiftRules.formatDate and .parseDate are deprecated and dateTimeConverter should be used now. Where can I find an explanation of example how to use it with different Locales?
Thanks,
-- Heiko Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net Stambecco, highly scalable computing: stambecco.org You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
Right now there isn't any built-in support for different locales. It's a regular FactoryMaker, so you just have to provide different DateTimeConverter instances based on any factor you like. I'm not sure of the Lift API to get the locale though.
On Sun, Apr 11, 2010 at 9:56 AM, Heiko Seeberger <[hidden email]> wrote: Hi, You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
On 11 April 2010 17:53, Naftoli Gugenheim <[hidden email]> wrote: Company: weiglewilczek.comRight now there isn't any built-in support for different locales. It's a regular FactoryMaker, so you just have to provide different DateTimeConverter instances based on any factor you like. I'm not sure of the Lift API to get the locale though. Thank you. I know how to handle the locale, but could you please provide me an example of how to use the FactoryMaker in order to set "my" DateTimeConverter? Heiko
Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net Stambecco, highly scalable computing: stambecco.org -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
yourfactorymaker.default.set(...) Cheers, Tim On 11 Apr 2010, at 17:15, Heiko Seeberger wrote:
-- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
For the global default as Tim says, though you need to create a closure to generate it --
LiftRules.dateTimeConverter.default.set(() => myDateTimeConverter) You can also manufacture one on a per-session basis: LiftRules.dateTimeConverter.session.set(() => S.session.map(s => makeMyDateTimeConverter(s))) Or per-request in much the same way. -Ross On Apr 11, 2010, at 12:19 PM, Timothy Perrett wrote:
You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
On 12 April 2010 00:14, Ross Mellgren <[hidden email]> wrote: Company: weiglewilczek.com
Per session?! That looks nice! Thanks. => We need a little documentation for this FactoryMaker thingy in the Wiki ... Heiko Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net Stambecco, highly scalable computing: stambecco.org -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
In reply to this post by Dridus
On Apr 12, 1:14 am, Ross Mellgren <[hidden email]> wrote: > For the global default as Tim says, though you need to create a closure to generate it -- > > LiftRules.dateTimeConverter.default.set(() => myDateTimeConverter) > > You can also manufacture one on a per-session basis: > > LiftRules.dateTimeConverter.session.set(() => S.session.map(s => makeMyDateTimeConverter(s))) > > Or per-request in much the same way. From the API perspective per session and per request functions passed to set should take a LiftSession respectively a Req as parameter. The API scope IMO would have been much clearer. I know you can obtain the session & req from S but the API for set is not very intuitive. Just my 2 cents ... Br's, Marius > > -Ross > > On Apr 11, 2010, at 12:19 PM, Timothy Perrett wrote: > > > > > yourfactorymaker.default.set(...) > > > Cheers, Tim > > > On 11 Apr 2010, at 17:15, Heiko Seeberger wrote: > > >> On 11 April 2010 17:53, Naftoli Gugenheim <[hidden email]> wrote: > >> Right now there isn't any built-in support for different locales. It's a regular FactoryMaker, so you just have to provide different DateTimeConverter instances based on any factor you like. I'm not sure of the Lift API to get the locale though. > > >> Thank you. I know how to handle the locale, but could you please provide me an example of how to use the FactoryMaker in order to set "my" DateTimeConverter? > > >> Heiko > > >> Company: weiglewilczek.com > >> Blog: heikoseeberger.name > >> Follow me: twitter.com/hseeberger > >> OSGi on Scala: scalamodules.org > >> Lift, the simply functional web framework: liftweb.net > >> Stambecco, highly scalable computing: stambecco.org > > >> -- > >> You received this message because you are subscribed to the Google Groups "Lift" group. > >> To post to this group, send email to [hidden email]. > >> To unsubscribe from this group, send email to [hidden email]. > >> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups "Lift" group. > > To post to this group, send email to [hidden email]. > > To unsubscribe from this group, send email to [hidden email]. > > For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
Yeah. That'd probably require something like Maker1[T1, R] in addition to the Maker[R] type, to accommodate the function argument.
-Ross On Apr 12, 2010, at 2:32 AM, Marius wrote: > > > On Apr 12, 1:14 am, Ross Mellgren <[hidden email]> wrote: >> For the global default as Tim says, though you need to create a closure to generate it -- >> >> LiftRules.dateTimeConverter.default.set(() => myDateTimeConverter) >> >> You can also manufacture one on a per-session basis: >> >> LiftRules.dateTimeConverter.session.set(() => S.session.map(s => makeMyDateTimeConverter(s))) >> >> Or per-request in much the same way. > > From the API perspective per session and per request functions passed > to set should take a LiftSession respectively a Req as parameter. The > API scope IMO would have been much clearer. I know you can obtain the > session & req from S but the API for set is not very intuitive. > > Just my 2 cents ... > > Br's, > Marius >> >> -Ross >> >> On Apr 11, 2010, at 12:19 PM, Timothy Perrett wrote: >> >> >> >>> yourfactorymaker.default.set(...) >> >>> Cheers, Tim >> >>> On 11 Apr 2010, at 17:15, Heiko Seeberger wrote: >> >>>> On 11 April 2010 17:53, Naftoli Gugenheim <[hidden email]> wrote: >>>> Right now there isn't any built-in support for different locales. It's a regular FactoryMaker, so you just have to provide different DateTimeConverter instances based on any factor you like. I'm not sure of the Lift API to get the locale though. >> >>>> Thank you. I know how to handle the locale, but could you please provide me an example of how to use the FactoryMaker in order to set "my" DateTimeConverter? >> >>>> Heiko >> >>>> Company: weiglewilczek.com >>>> Blog: heikoseeberger.name >>>> Follow me: twitter.com/hseeberger >>>> OSGi on Scala: scalamodules.org >>>> Lift, the simply functional web framework: liftweb.net >>>> Stambecco, highly scalable computing: stambecco.org >> >>>> -- >>>> You received this message because you are subscribed to the Google Groups "Lift" group. >>>> To post to this group, send email to [hidden email]. >>>> To unsubscribe from this group, send email to [hidden email]. >>>> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. >> >>> -- >>> You received this message because you are subscribed to the Google Groups "Lift" group. >>> To post to this group, send email to [hidden email]. >>> To unsubscribe from this group, send email to [hidden email]. >>> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Lift" group. > To post to this group, send email to [hidden email]. > To unsubscribe from this group, send email to [hidden email]. > For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. > -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
Hm yeah, +1 Marius/Ross. Sounds like a good idea.
Cheers, Tim On 12 Apr 2010, at 07:41, Ross Mellgren wrote: > Yeah. That'd probably require something like Maker1[T1, R] in addition to the Maker[R] type, to accommodate the function argument. > > -Ross > > > > On Apr 12, 2010, at 2:32 AM, Marius wrote: > >> >> >> On Apr 12, 1:14 am, Ross Mellgren <[hidden email]> wrote: >>> For the global default as Tim says, though you need to create a closure to generate it -- >>> >>> LiftRules.dateTimeConverter.default.set(() => myDateTimeConverter) >>> >>> You can also manufacture one on a per-session basis: >>> >>> LiftRules.dateTimeConverter.session.set(() => S.session.map(s => makeMyDateTimeConverter(s))) >>> >>> Or per-request in much the same way. >> >> From the API perspective per session and per request functions passed >> to set should take a LiftSession respectively a Req as parameter. The >> API scope IMO would have been much clearer. I know you can obtain the >> session & req from S but the API for set is not very intuitive. >> >> Just my 2 cents ... >> >> Br's, >> Marius >>> >>> -Ross >>> >>> On Apr 11, 2010, at 12:19 PM, Timothy Perrett wrote: >>> >>> >>> >>>> yourfactorymaker.default.set(...) >>> >>>> Cheers, Tim >>> >>>> On 11 Apr 2010, at 17:15, Heiko Seeberger wrote: >>> >>>>> On 11 April 2010 17:53, Naftoli Gugenheim <[hidden email]> wrote: >>>>> Right now there isn't any built-in support for different locales. It's a regular FactoryMaker, so you just have to provide different DateTimeConverter instances based on any factor you like. I'm not sure of the Lift API to get the locale though. >>> >>>>> Thank you. I know how to handle the locale, but could you please provide me an example of how to use the FactoryMaker in order to set "my" DateTimeConverter? >>> >>>>> Heiko >>> >>>>> Company: weiglewilczek.com >>>>> Blog: heikoseeberger.name >>>>> Follow me: twitter.com/hseeberger >>>>> OSGi on Scala: scalamodules.org >>>>> Lift, the simply functional web framework: liftweb.net >>>>> Stambecco, highly scalable computing: stambecco.org >>> >>>>> -- >>>>> You received this message because you are subscribed to the Google Groups "Lift" group. >>>>> To post to this group, send email to [hidden email]. >>>>> To unsubscribe from this group, send email to [hidden email]. >>>>> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. >>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups "Lift" group. >>>> To post to this group, send email to [hidden email]. >>>> To unsubscribe from this group, send email to [hidden email]. >>>> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups "Lift" group. >> To post to this group, send email to [hidden email]. >> To unsubscribe from this group, send email to [hidden email]. >> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups "Lift" group. > To post to this group, send email to [hidden email]. > To unsubscribe from this group, send email to [hidden email]. > For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
In reply to this post by Heiko Seeberger-4
Don't session and request set the value *once* for the *current* session or request?
The regular set method takes a function, so if that function reads the session or request the value will be session- or request- *dependent*. I think the purpose of session and request is to set a different function temporarily. ------------------------------------- Marius<[hidden email]> wrote: On Apr 12, 1:14 am, Ross Mellgren <[hidden email]> wrote: > For the global default as Tim says, though you need to create a closure to generate it -- > > LiftRules.dateTimeConverter.default.set(() => myDateTimeConverter) > > You can also manufacture one on a per-session basis: > > LiftRules.dateTimeConverter.session.set(() => S.session.map(s => makeMyDateTimeConverter(s))) > > Or per-request in much the same way. From the API perspective per session and per request functions passed to set should take a LiftSession respectively a Req as parameter. The API scope IMO would have been much clearer. I know you can obtain the session & req from S but the API for set is not very intuitive. Just my 2 cents ... Br's, Marius > > -Ross > > On Apr 11, 2010, at 12:19 PM, Timothy Perrett wrote: > > > > > yourfactorymaker.default.set(...) > > > Cheers, Tim > > > On 11 Apr 2010, at 17:15, Heiko Seeberger wrote: > > >> On 11 April 2010 17:53, Naftoli Gugenheim <[hidden email]> wrote: > >> Right now there isn't any built-in support for different locales. It's a regular FactoryMaker, so you just have to provide different DateTimeConverter instances based on any factor you like. I'm not sure of the Lift API to get the locale though. > > >> Thank you. I know how to handle the locale, but could you please provide me an example of how to use the FactoryMaker in order to set "my" DateTimeConverter? > > >> Heiko > > >> Company: weiglewilczek.com > >> Blog: heikoseeberger.name > >> Follow me: twitter.com/hseeberger > >> OSGi on Scala: scalamodules.org > >> Lift, the simply functional web framework: liftweb.net > >> Stambecco, highly scalable computing: stambecco.org > > >> -- > >> You received this message because you are subscribed to the Google Groups "Lift" group. > >> To post to this group, send email to [hidden email]. > >> To unsubscribe from this group, send email to [hidden email]. > >> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups "Lift" group. > > To post to this group, send email to [hidden email]. > > To unsubscribe from this group, send email to [hidden email]. > > For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
That's besides the point I'm making.
Instead of LiftRules.dateTimeConverter.session.set(() => S.session.map(s => makeMyDateTimeConverter(s))) we'd have LiftRules.dateTimeConverter.session.set((s) => makeMyDateTimeConverter(s)) So you'd have the session provided to you as opposed of fetching it from S. To me this is a distinct API design approach that is more appropriate. But that's just me. Br's, Marius On Apr 12, 3:13 pm, Naftoli Gugenheim <[hidden email]> wrote: > Don't session and request set the value *once* for the *current* session or request? > The regular set method takes a function, so if that function reads the session or request the value will be session- or request- *dependent*. I think the purpose of session and request is to set a different function temporarily. > > ------------------------------------- > > Marius<[hidden email]> wrote: > > On Apr 12, 1:14 am, Ross Mellgren <[hidden email]> wrote: > > > For the global default as Tim says, though you need to create a closure to generate it -- > > > LiftRules.dateTimeConverter.default.set(() => myDateTimeConverter) > > > You can also manufacture one on a per-session basis: > > > LiftRules.dateTimeConverter.session.set(() => S.session.map(s => makeMyDateTimeConverter(s))) > > > Or per-request in much the same way. > > From the API perspective per session and per request functions passed > to set should take a LiftSession respectively a Req as parameter. The > API scope IMO would have been much clearer. I know you can obtain the > session & req from S but the API for set is not very intuitive. > > Just my 2 cents ... > > Br's, > Marius > > > > > > > > > -Ross > > > On Apr 11, 2010, at 12:19 PM, Timothy Perrett wrote: > > > > yourfactorymaker.default.set(...) > > > > Cheers, Tim > > > > On 11 Apr 2010, at 17:15, Heiko Seeberger wrote: > > > >> On 11 April 2010 17:53, Naftoli Gugenheim <[hidden email]> wrote: > > >> Right now there isn't any built-in support for different locales. It's a regular FactoryMaker, so you just have to provide different DateTimeConverter instances based on any factor you like. I'm not sure of the Lift API to get the locale though. > > > >> Thank you. I know how to handle the locale, but could you please provide me an example of how to use the FactoryMaker in order to set "my" DateTimeConverter? > > > >> Heiko > > > >> Company: weiglewilczek.com > > >> Blog: heikoseeberger.name > > >> Follow me: twitter.com/hseeberger > > >> OSGi on Scala: scalamodules.org > > >> Lift, the simply functional web framework: liftweb.net > > >> Stambecco, highly scalable computing: stambecco.org > > > >> -- > > >> You received this message because you are subscribed to the Google Groups "Lift" group. > > >> To post to this group, send email to [hidden email]. > > >> To unsubscribe from this group, send email to [hidden email]. > > >> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. > > > > -- > > > You received this message because you are subscribed to the Google Groups "Lift" group. > > > To post to this group, send email to [hidden email]. > > > To unsubscribe from this group, send email to [hidden email]. > > > For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Lift" group. > To post to this group, send email to [hidden email]. > To unsubscribe from this group, send email to [hidden email]. > For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
Ah, I got it.
Is it possible to have both? Or are you saying you'd prefer it changed? Also, what if there is no session? Would s be a Box?
-- On Mon, Apr 12, 2010 at 11:37 AM, Marius <[hidden email]> wrote: That's besides the point I'm making. You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
|
Folks,
You surely follow the other thread? The one where I would like to get rid of the FactoryMaker thing? This would make this discussion obsolete ... Heiko
--
On 12 April 2010 18:28, Naftoli Gugenheim <[hidden email]> wrote: Ah, I got it. -- Heiko Seeberger Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net Stambecco, highly scalable computing: stambecco.org You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. |
| Powered by Nabble | See how NAML generates this page |
