Package org.joda.time

Examples of org.joda.time.MutableDateTime.hourOfDay()


                        break;
                    case 'h':
                    case 'H':
                        if (type == 0) {
                            if (roundUp) {
                                dateTime.hourOfDay().roundCeiling();
                            } else {
                                dateTime.hourOfDay().roundFloor();
                            }
                        } else if (type == 1) {
                            dateTime.addHours(num);
View Full Code Here


                    case 'H':
                        if (type == 0) {
                            if (roundUp) {
                                dateTime.hourOfDay().roundCeiling();
                            } else {
                                dateTime.hourOfDay().roundFloor();
                            }
                        } else if (type == 1) {
                            dateTime.addHours(num);
                        } else if (type == 2) {
                            dateTime.addHours(-num);
View Full Code Here

        long TIME = utcTimeInMillis("2009-02-03T01:01:01");
        MutableDateTime time = new MutableDateTime(DateTimeZone.UTC);
        time.setMillis(TIME);
        assertThat(time.monthOfYear().roundFloor().toString(), equalTo("2009-02-01T00:00:00.000Z"));
        time.setMillis(TIME);
        assertThat(time.hourOfDay().roundFloor().toString(), equalTo("2009-02-03T01:00:00.000Z"));
        time.setMillis(TIME);
        assertThat(time.dayOfMonth().roundFloor().toString(), equalTo("2009-02-03T00:00:00.000Z"));
    }

    @Test
View Full Code Here

        DateMidnight start = end.minus(Months.months(MONTHS_TO_GO_BACK));
        List<Activity> activities = new ArrayList<Activity>();
        MutableDateTime mdt = new MutableDateTime(start, timeZone);
        while (mdt.isBefore(end))
        {
            mdt.hourOfDay().set(9);
            int activitiesCount = 1 + random.nextInt(ACTIVITIES_PER_DAY);
            int hours = 2 + random.nextInt(6) / activitiesCount;
            for (int j = 0; j < activitiesCount; j++)
            {
                Activity activity = new Activity(loremIpsum.randomWords(2), loremIpsum.randomWords(4), timeZone);
View Full Code Here

            int hours = 2 + random.nextInt(6) / activitiesCount;
            for (int j = 0; j < activitiesCount; j++)
            {
                Activity activity = new Activity(loremIpsum.randomWords(2), loremIpsum.randomWords(4), timeZone);
                activity.setStart(new Time(mdt));
                int hour = mdt.hourOfDay().get() + hours;
                activity.setEnd(new Time(mdt.copy().hourOfDay().set(hour)));
                activity.setProject(Ref.create(projects.get(random.nextInt(projects.size()))));
                for (int i = 0; i < TAGS_PER_ACTIVITY; i++)
                {
                    Tag tag = tagKeys.get(random.nextInt(tagKeys.size()));
View Full Code Here

                {
                    Tag tag = tagKeys.get(random.nextInt(tagKeys.size()));
                    activity.addTag(Key.create(tag));
                }
                activities.add(activity);
                mdt.hourOfDay().add(hours);
            }
            mdt.addDays(1);
        }
        return activities;
    }
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.