[threeten-dev] [threeten-develop] #251: Add atEndOfMonth() to YearMonth

Stephen Colebourne scolebourne at joda.org
Fri Feb 1 10:01:12 PST 2013


Implementation looks good to me.
Stephen

On 1 February 2013 17:47, Michael Nascimento <misterm at gmail.com> wrote:
> Hi guys,
>
> In the absense of a working webrev, this is the proposed
> implementation of this issue:
>
>     //-----------------------------------------------------------------------
>     /**
>      * Combines this year-month with the last valid day of this
> year-month to create a {@code LocalDate}.
>      * <p>
>      * This method can be used as part of a chain to produce a date:
>      * <pre>
>      *  LocalDate date = year.atMonth(month).atEndOfMonth();
>      * </pre>
>      *
>      * @return the date formed from this year-month and the last valid
> day of this year-month, not null
>      */
>     public LocalDate atEndOfMonth() {
>         return LocalDate.of(year, month, lengthOfMonth());
>     }
>
> I will write the tests when I get them to run in my hacked OpenJDK (sigh).
>
> Regards,
> Michael
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> _______________________________________________
> threeten-develop mailing list
> threeten-develop at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/threeten-develop


More information about the threeten-dev mailing list