Package org.joda.time

Examples of org.joda.time.DateMidnight.year()


    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1, GJChronology.getInstance());
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
    }
View Full Code Here


    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1);
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
    }
View Full Code Here

    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1, GJChronology.getInstance());
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
    }
View Full Code Here

    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1);
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
    }
View Full Code Here

    @Path("/{year:\\d{4}}/{month:\\d{1,2}}")
    public Response activitiesForYearMonth(@PathParam("year") int year, @PathParam("month") int month)
    {
        DateMidnight yearMonth = new DateMidnight(year, month, 1, settings.get().getTimeZone());
        Activities activities = activitiesConverter.toModel(yearMonth, MONTH,
                repository.findByYearMonth(yearMonth.year().get(), yearMonth.monthOfYear().get()));
        return addLinksForYearMonth(activities, yearMonth);
    }

    @GET
    @Produces(TEXT_PLAIN)
View Full Code Here

    @Produces(TEXT_PLAIN)
    @Path("/{year:\\d{4}}/{month:\\d{1,2}}/duration")
    public Duration minutesForYearMonth(@PathParam("year") int year, @PathParam("month") int month)
    {
        DateMidnight date = new DateMidnight(year, month, 1, settings.get().getTimeZone());
        return minutes(repository.findByYearMonth(date.year().get(), date.monthOfYear().get()));
    }

    @GET
    @Path("/relative/{month:[+-]?\\d+}")
    public Response activitiesForRelativeMonth(@PathParam("month") int month)
View Full Code Here

    @Path("/relative/{month:[+-]?\\d+}")
    public Response activitiesForRelativeMonth(@PathParam("month") int month)
    {
        DateMidnight absolute = absoluteMonth(month);
        Activities activities = activitiesConverter.toModel(absolute, MONTH,
                repository.findByYearMonth(absolute.year().get(), absolute.monthOfYear().get()));
        return addLinksForYearMonth(activities, absolute);
    }

    @GET
    @Produces(TEXT_PLAIN)
View Full Code Here

    @Produces(TEXT_PLAIN)
    @Path("/relative/{month:[+-]?\\d+}/duration")
    public Duration minutesForRelativeMonth(@PathParam("month") int month)
    {
        DateMidnight date = absoluteMonth(month);
        return minutes(repository.findByYearMonth(date.year().get(), date.monthOfYear().get()));
    }

    @GET
    @Path("/currentMonth")
    public Response activitiesForCurrentMonth()
View Full Code Here

    @Path("/currentMonth")
    public Response activitiesForCurrentMonth()
    {
        DateMidnight now = now(settings.get().getTimeZone());
        Activities activities = activitiesConverter.toModel(now, MONTH,
                repository.findByYearMonth(now.year().get(), now.monthOfYear().get()));
        return addLinksForYearMonth(activities, now);
    }

    @GET
    @Produces(TEXT_PLAIN)
View Full Code Here

    @Produces(TEXT_PLAIN)
    @Path("/currentMonth/duration")
    public Duration minutesForCurrentMonth()
    {
        DateMidnight date = now(settings.get().getTimeZone());
        return minutes(repository.findByYearMonth(date.year().get(), date.monthOfYear().get()));
    }

    private DateMidnight absoluteMonth(int month)
    {
        DateMidnight now = now(settings.get().getTimeZone());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.