Package org.joda.time

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


        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());
        }
    }

    public void testPartialGetAsText() {
        GJChronology chrono = GJChronology.getInstance(TOKYO);
View Full Code Here


        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());
        }
    }

    public void testLeap_28feb() {
        Chronology chrono = ISOChronology.getInstance();
View Full Code Here

        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());
        }
    }

    public void testPartialGetAsText() {
        GJChronology chrono = GJChronology.getInstance(TOKYO);
View Full Code Here

        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 Response activitiesForYearMonthDay(@PathParam("year") int year, @PathParam("month") int month,
            @PathParam("day") int day)
    {
        DateMidnight yearMonthDay = new DateMidnight(year, month, day, settings.get().getTimeZone());
        Activities activities = activitiesConverter.toModel(yearMonthDay, DAY,
                repository.findByYearMonthDay(yearMonthDay.year().get(), yearMonthDay.monthOfYear().get(), yearMonthDay
                        .dayOfMonth().get()));
        return addLinksForYearMonthDay(activities, yearMonthDay);
    }

    @GET
View Full Code Here

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

    @GET
    @Path("/today")
View Full Code Here

    @Path("/today")
    public Response activitiesForToday()
    {
        DateMidnight now = now(settings.get().getTimeZone());
        Activities activities = activitiesConverter.toModel(now, DAY,
                repository.findByYearMonthDay(now.year().get(), now.monthOfYear().get(), now
                        .dayOfMonth().get()));
        return addLinksForYearMonthDay(activities, now);
    }

    @GET
View Full Code Here

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

    private Response addLinksForYearMonthDay(Activities activities, DateMidnight yearMonthDay)
    {
View Full Code Here

        DateMidnight prevDay = yearMonthDay.minusDays(1);
        DateMidnight nextDay = yearMonthDay.plusDays(1);
        boolean hasPrev = repository.hasActivitiesByYearMonthDay(prevDay.year().get(), prevDay.monthOfYear().get(),
                prevDay.dayOfMonth().get());
        boolean hasNext = repository.hasActivitiesByYearMonthDay(nextDay.year().get(), nextDay.monthOfYear().get(),
                nextDay.dayOfMonth().get());
        if (hasPrev)
        {
            String prev = uriInfo
                    .getBaseUriBuilder()
                    .path("activities")
View Full Code Here

        {
            String next = uriInfo
                    .getBaseUriBuilder()
                    .path("activities")
                    .segment(String.valueOf(nextDay.year().get()), String.valueOf(nextDay.monthOfYear().get()),
                            String.valueOf(nextDay.dayOfMonth().get())).build().toASCIIString();
            linkHeader.addLink(null, NEXT, next, null);
        }

        Response.ResponseBuilder response;
        if (!activities.isEmpty())
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.