Examples of weekOfWeekyear()


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

    {
        DateMidnight yearWeek = new MutableDateTime(settings.get().getTimeZone()).year().set(year).weekOfWeekyear()
                .set(week)
                .toDateTime().toDateMidnight();
        Activities activities = activitiesConverter.toModel(yearWeek, WEEK,
                repository.findByYearWeek(yearWeek.year().get(), yearWeek.weekOfWeekyear().get()));
        return addLinksForYearWeek(activities, yearWeek);
    }

    @GET
    @Produces(TEXT_PLAIN)
View Full Code Here

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

    public Duration minutesForYearWeek(@PathParam("year") int year, @PathParam("week") int week)
    {
        DateMidnight yearWeek = new MutableDateTime(settings.get().getTimeZone()).year().set(year).weekOfWeekyear()
                .set(week)
                .toDateTime().toDateMidnight();
        return minutes(repository.findByYearWeek(yearWeek.year().get(), yearWeek.weekOfWeekyear().get()));
    }

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

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

    @Path("/relative/cw{week:[+-]?\\d+}")
    public Response activitiesForRelativeWeek(@PathParam("week") int week)
    {
        DateMidnight absolute = absoluteWeek(week);
        Activities activities = activitiesConverter.toModel(absolute, WEEK,
                repository.findByYearWeek(absolute.year().get(), absolute.weekOfWeekyear().get()));
        return addLinksForYearWeek(activities, absolute);
    }

    @GET
    @Produces(TEXT_PLAIN)
View Full Code Here

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

    @Produces(TEXT_PLAIN)
    @Path("/relative/cw{week:[+-]?\\d+}/duration")
    public Duration minutesForRelativeWeek(@PathParam("week") int week)
    {
        DateMidnight date = absoluteWeek(week);
        return minutes(repository.findByYearWeek(date.year().get(), date.weekOfWeekyear().get()));
    }

    @GET
    @Path("/currentWeek")
    public Response activitiesForCurrentWeek()
View Full Code Here

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

    @Path("/currentWeek")
    public Response activitiesForCurrentWeek()
    {
        DateMidnight now = now(settings.get().getTimeZone());
        Activities activities = activitiesConverter.toModel(now, WEEK,
                repository.findByYearWeek(now.year().get(), now.weekOfWeekyear().get()));
        return addLinksForYearWeek(activities, now);
    }

    @GET
    @Produces(TEXT_PLAIN)
View Full Code Here

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

    @Produces(TEXT_PLAIN)
    @Path("/currentWeek/duration")
    public Duration minutesForCurrentWeek()
    {
        DateMidnight date = now(settings.get().getTimeZone());
        return minutes(repository.findByYearWeek(date.year().get(), date.weekOfWeekyear().get()));
    }

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

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

        linkHeader.addLink(null, SELF, self, null);

        DateMidnight prevWeek = yearWeek.minusWeeks(1);
        DateMidnight nextWeek = yearWeek.plusWeeks(1);
        boolean hasPrev = repository.hasActivitiesByYearWeek(prevWeek.year().get(), prevWeek.weekOfWeekyear().get());
        boolean hasNext = repository.hasActivitiesByYearWeek(nextWeek.year().get(), nextWeek.weekOfWeekyear().get());
        if (hasPrev)
        {
            String prev = uriInfo
                    .getBaseUriBuilder()
                    .path("activities")
View Full Code Here

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

        {
            String next = uriInfo
                    .getBaseUriBuilder()
                    .path("activities")
                    .segment(String.valueOf(nextWeek.year().get()),
                            "cw" + String.valueOf(nextWeek.weekOfWeekyear().get())).build().toASCIIString();
            linkHeader.addLink(null, NEXT, next, null);
        }

        Response.ResponseBuilder response;
        if (!activities.isEmpty())
View Full Code Here

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

    public Response minutesForCurrentMonthWeekAndDay()
    {
        DateMidnight now = now(settings.get().getTimeZone());
        int year = now.year().get();
        int month = now.monthOfYear().get();
        int week = now.weekOfWeekyear().get();
        int day = now.dayOfMonth().get();
        Duration currentMonth = minutes(repository.findByYearMonth(year, month));
        Duration currentWeek = minutes(repository.findByYearWeek(year, week));
        Duration today = minutes(repository.findByYearMonthDay(year, month, day));
        Durations durations = new Durations(currentMonth, currentWeek, today);
View Full Code Here

Examples of org.joda.time.DateTime.weekOfWeekyear()

        assertFunction("dow(" + seconds + ")", dateTime.dayOfWeek().get());
        assertFunction("day(" + seconds + ")", dateTime.getDayOfMonth());
        assertFunction("day_of_month(" + seconds + ")", dateTime.getDayOfMonth());
        assertFunction("day_of_year(" + seconds + ")", dateTime.dayOfYear().get());
        assertFunction("doy(" + seconds + ")", dateTime.dayOfYear().get());
        assertFunction("week(" + seconds + ")", dateTime.weekOfWeekyear().get());
        assertFunction("week_of_year(" + seconds + ")", dateTime.weekOfWeekyear().get());
        assertFunction("month(" + seconds + ")", dateTime.getMonthOfYear());
        assertFunction("quarter(" + seconds + ")", dateTime.getMonthOfYear() / 4 + 1);
        assertFunction("year(" + seconds + ")", dateTime.getYear());
        assertFunction("century(" + seconds + ")", dateTime.getCenturyOfEra());
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.