I believe that you do the following, although I've never used the feature!

  Chronology lenient =
LenientChronology.getInstance(ISOChronology.getInstance());
  formatter = formatter.withChronology(chrono);
  // continue parsing as normal

Stephen


On 29 July 2010 19:24, Robin Tharappel <rtharap...@gmail.com> wrote:
> Hello,
>
> I was looking for an example of configuring a Joda parser to be more
> lenient when parsing a value or an example of changing the range of
> acceptable values for a field. For example if I have the following
> value for a fiscal week (format yyyy'W'ww) representing a 54 week.
>
>
> DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy'W'ww");
> DateTime dateTime = formatter.parseDateTime("2009W54");
>
> This would throw an exception:
>
> Cannot parse "2009W54": Value 54 for weekOfWeekyear must be in the range 
> [1,52]
>
> There appear to be support specifying a field as lenient
>
> http://joda-time.sourceforge.net/api-release/org/joda/time/field/LenientDateTimeField.html
>
> How would you configure the DateTimeFormatter to have a lenient field ?
>
> Thanks
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to