date.dayOfMonth().withMaximumValue();

Stephen


Andreas Rudolf wrote:
> Hi,
> 
> how is it possible to calculate the end of a month with respect to a 
> calendar.
> 
> I used something like this:
> 
> LocalDate marchEnd = new LocalDate("2008-03-31");
> Period monthPeriod = new Period.months(1);
> LocalDate febEnd = marchEnd.minus(monthPeriod);   // Results into 
> 29.02.2008
> LocalDate janEnd = febEnd.minus(monthPeriod);  // Results into 29.01.2008
> 
> I was expecting the 31.1.2008.
> 
> How is it possible to decrease by a period of one month and receive 
> always the correct end of month day?
> 
> Regards
> Andreas
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to