Example usage for java.util Calendar NOVEMBER

List of usage examples for java.util Calendar NOVEMBER

Introduction

In this page you can find the example usage for java.util Calendar NOVEMBER.

Prototype

int NOVEMBER

To view the source code for java.util Calendar NOVEMBER.

Click Source Link

Document

Value of the #MONTH field indicating the eleventh month of the year in the Gregorian and Julian calendars.

Usage

From source file:edu.northwestern.bioinformatics.studycalendar.dao.reporting.ScheduledActivitiesReportRowDaoTest.java

public void testSearchWithStopDateFilter_Pos() {
    MutableRange<Date> range = new MutableRange<Date>();
    range.setStop(DateUtils.createDate(2006, Calendar.NOVEMBER, 5));
    filters.setActualActivityDate(range);
    assertSearchWithResults(NEG_16);/*from w  w w. j a  v a2s  .co  m*/
}

From source file:org.sakaiproject.util.CalendarUtil.java

void initDates() {
    Calendar calendarSunday = Calendar.getInstance();
    Calendar calendarMonday = Calendar.getInstance();
    Calendar calendarTuesday = Calendar.getInstance();
    Calendar calendarWednesday = Calendar.getInstance();
    Calendar calendarThursday = Calendar.getInstance();
    Calendar calendarFriday = Calendar.getInstance();
    Calendar calendarSaturday = Calendar.getInstance();

    calendarSunday.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
    calendarMonday.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
    calendarTuesday.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);
    calendarWednesday.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);
    calendarThursday.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY);
    calendarFriday.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
    calendarSaturday.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);

    dateSunday = calendarSunday.getTime();
    dateMonday = calendarMonday.getTime();
    dateTuesday = calendarTuesday.getTime();
    dateWednesday = calendarWednesday.getTime();
    dateThursday = calendarThursday.getTime();
    dateFriday = calendarFriday.getTime();
    dateSaturday = calendarSaturday.getTime();

    Calendar calendarJanuary = Calendar.getInstance();
    Calendar calendarFebruary = Calendar.getInstance();
    Calendar calendarMarch = Calendar.getInstance();
    Calendar calendarApril = Calendar.getInstance();
    Calendar calendarMay = Calendar.getInstance();
    Calendar calendarJune = Calendar.getInstance();
    Calendar calendarJuly = Calendar.getInstance();
    Calendar calendarAugust = Calendar.getInstance();
    Calendar calendarSeptember = Calendar.getInstance();
    Calendar calendarOctober = Calendar.getInstance();
    Calendar calendarNovember = Calendar.getInstance();
    Calendar calendarDecember = Calendar.getInstance();

    calendarJanuary.set(Calendar.MONTH, Calendar.JANUARY);
    calendarFebruary.set(Calendar.MONTH, Calendar.FEBRUARY);
    calendarMarch.set(Calendar.MONTH, Calendar.MARCH);
    calendarApril.set(Calendar.MONTH, Calendar.APRIL);
    calendarMay.set(Calendar.MONTH, Calendar.MAY);
    calendarJune.set(Calendar.MONTH, Calendar.JUNE);
    calendarJuly.set(Calendar.MONTH, Calendar.JULY);
    calendarAugust.set(Calendar.MONTH, Calendar.AUGUST);
    calendarSeptember.set(Calendar.MONTH, Calendar.SEPTEMBER);
    calendarOctober.set(Calendar.MONTH, Calendar.OCTOBER);
    calendarNovember.set(Calendar.MONTH, Calendar.NOVEMBER);
    calendarDecember.set(Calendar.MONTH, Calendar.DECEMBER);

    dateJanuary = calendarJanuary.getTime();
    dateFebruary = calendarFebruary.getTime();
    dateMarch = calendarMarch.getTime();
    dateApril = calendarApril.getTime();
    dateMay = calendarMay.getTime();/*from w  w  w  . j  av a 2s  . c  om*/
    dateJune = calendarJune.getTime();
    dateJuly = calendarJuly.getTime();
    dateAugust = calendarAugust.getTime();
    dateSeptember = calendarSeptember.getTime();
    dateOctober = calendarOctober.getTime();
    dateNovember = calendarNovember.getTime();
    dateDecember = calendarDecember.getTime();

}

From source file:edu.northwestern.bioinformatics.studycalendar.dao.reporting.ScheduledActivitiesReportRowDaoTest.java

public void testSearchWithStartIdealDateFilter_Pos() {
    MutableRange<Date> range = new MutableRange<Date>();
    range.setStart(DateUtils.createDate(2006, Calendar.NOVEMBER, 5));
    filters.setIdealDate(range);/*ww  w  .  j  a va 2  s  .c  o m*/
    assertSearchWithResults(NEG_19, NEG_18);
}

From source file:edu.northwestern.bioinformatics.studycalendar.dao.reporting.ScheduledActivitiesReportRowDaoTest.java

public void testSearchWithStopIdealDateFilter_Pos() {
    MutableRange<Date> range = new MutableRange<Date>();
    range.setStop(DateUtils.createDate(2006, Calendar.NOVEMBER, 5));
    filters.setIdealDate(range);// w  ww  .  j  a va 2s.c  o  m
    assertSearchWithResults(NEG_17, NEG_16);
}

From source file:org.openmrs.module.reporting.common.DateUtilTest.java

@Test
@Verifies(value = "should correctly handle daylight savings time", method = "getTimespan(Date,Date,null)")
public void getTimespan_shouldCorrectlyHandleDaylightSavingsTime() throws Exception {
    // USA has daylight saving time.
    // in 2009 DST started March 8 and ended November 1

    Calendar cal = new GregorianCalendar(Locale.US);
    cal.set(Calendar.YEAR, 2009);
    cal.set(Calendar.DAY_OF_MONTH, 25);

    cal.set(Calendar.MONTH, Calendar.FEBRUARY);
    Date feb25 = cal.getTime();//from www .j  a v a  2s .  c  o  m

    cal.set(Calendar.MONTH, Calendar.MARCH);
    Date mar25 = cal.getTime();

    cal.set(Calendar.MONTH, Calendar.APRIL);
    Date apr25 = cal.getTime();

    cal.set(Calendar.MONTH, Calendar.OCTOBER);
    Date oct25 = cal.getTime();

    cal.set(Calendar.MONTH, Calendar.NOVEMBER);
    Date nov25 = cal.getTime();

    cal.set(Calendar.MONTH, Calendar.DECEMBER);
    Date dec25 = cal.getTime();

    testMessage("reporting.dateUtil.oneMonth reporting.dateUtil.ago", DateUtil.getTimespan(mar25, feb25));
    testMessage("reporting.dateUtil.oneMonth reporting.dateUtil.ago", DateUtil.getTimespan(apr25, mar25));
    testMessage("reporting.dateUtil.oneMonth reporting.dateUtil.ago", DateUtil.getTimespan(nov25, oct25));
    testMessage("reporting.dateUtil.oneMonth reporting.dateUtil.ago", DateUtil.getTimespan(dec25, nov25));
}

From source file:com.gemstone.gemfire.rest.internal.web.controllers.RestAPIsWithSSLDUnitTest.java

public void doPutsInClientCache() {
    ClientCache cache = GemFireCacheImpl.getInstance();
    assertNotNull(cache);/*  www. j  a v  a2  s.  com*/
    Region<String, Object> region = cache.getRegion(PEOPLE_REGION_NAME);

    // put person object
    final Person person1 = new Person(101L, "Mithali", "Dorai", "Raj",
            DateTimeUtils.createDate(1982, Calendar.DECEMBER, 4), Gender.FEMALE);
    final Person person2 = new Person(102L, "Sachin", "Ramesh", "Tendulkar",
            DateTimeUtils.createDate(1975, Calendar.DECEMBER, 14), Gender.MALE);
    final Person person3 = new Person(103L, "Saurabh", "Baburav", "Ganguly",
            DateTimeUtils.createDate(1972, Calendar.AUGUST, 29), Gender.MALE);
    final Person person4 = new Person(104L, "Rahul", "subrymanyam", "Dravid",
            DateTimeUtils.createDate(1979, Calendar.MARCH, 17), Gender.MALE);
    final Person person5 = new Person(105L, "Jhulan", "Chidambaram", "Goswami",
            DateTimeUtils.createDate(1983, Calendar.NOVEMBER, 25), Gender.FEMALE);

    region.put("1", person1);
    region.put("2", person2);
    region.put("3", person3);
    region.put("4", person4);
    region.put("5", person5);

    final Person person6 = new Person(101L, "Rahul", "Rajiv", "Gndhi",
            DateTimeUtils.createDate(1970, Calendar.MAY, 14), Gender.MALE);
    final Person person7 = new Person(102L, "Narendra", "Damodar", "Modi",
            DateTimeUtils.createDate(1945, Calendar.DECEMBER, 24), Gender.MALE);
    final Person person8 = new Person(103L, "Atal", "Bihari", "Vajpayee",
            DateTimeUtils.createDate(1920, Calendar.AUGUST, 9), Gender.MALE);
    final Person person9 = new Person(104L, "Soniya", "Rajiv", "Gandhi",
            DateTimeUtils.createDate(1929, Calendar.MARCH, 27), Gender.FEMALE);
    final Person person10 = new Person(104L, "Priyanka", "Robert", "Gandhi",
            DateTimeUtils.createDate(1973, Calendar.APRIL, 15), Gender.FEMALE);

    final Person person11 = new Person(104L, "Murali", "Manohar", "Joshi",
            DateTimeUtils.createDate(1923, Calendar.APRIL, 25), Gender.MALE);
    final Person person12 = new Person(104L, "Lalkrishna", "Parmhansh", "Advani",
            DateTimeUtils.createDate(1910, Calendar.JANUARY, 01), Gender.MALE);
    final Person person13 = new Person(104L, "Shushma", "kumari", "Swaraj",
            DateTimeUtils.createDate(1943, Calendar.AUGUST, 10), Gender.FEMALE);
    final Person person14 = new Person(104L, "Arun", "raman", "jetly",
            DateTimeUtils.createDate(1942, Calendar.OCTOBER, 27), Gender.MALE);
    final Person person15 = new Person(104L, "Amit", "kumar", "shah",
            DateTimeUtils.createDate(1958, Calendar.DECEMBER, 21), Gender.MALE);
    final Person person16 = new Person(104L, "Shila", "kumari", "Dixit",
            DateTimeUtils.createDate(1927, Calendar.FEBRUARY, 15), Gender.FEMALE);

    Map<String, Object> userMap = new HashMap<String, Object>();
    userMap.put("6", person6);
    userMap.put("7", person7);
    userMap.put("8", person8);
    userMap.put("9", person9);
    userMap.put("10", person10);
    userMap.put("11", person11);
    userMap.put("12", person12);
    userMap.put("13", person13);
    userMap.put("14", person14);
    userMap.put("15", person15);
    userMap.put("16", person16);

    region.putAll(userMap);

    if (cache != null)
        cache.getLogger().info("Gemfire Cache Client: Puts successfully done");

}

From source file:netmason.support.graphics.GanttDisplay.java

/**
 * Creates a sample dataset for a Gantt chart, using sub-tasks. In general,
 * you won't hard-code the dataset in this way - it's done here so that the
 * demo is self-contained.//  w w w.  j  av a2  s  .  c om
 * 
 * @return The dataset.
 */
private IntervalCategoryDataset createSampleDataset() {

    final Task t1 = new Task("Write Proposal", date(1, Calendar.APRIL, 2001), date(5, Calendar.APRIL, 2001));
    t1.setPercentComplete(1.00);
    s1.add(t1);

    final Task t2 = new Task("Obtain Approval", date(9, Calendar.APRIL, 2001), date(9, Calendar.APRIL, 2001));
    t2.setPercentComplete(1.00);
    s1.add(t2);

    // here is a task split into two subtasks...
    final Task t3 = new Task("Requirements Analysis", date(10, Calendar.APRIL, 2001),
            date(5, Calendar.MAY, 2001));
    final Task st31 = new Task("Requirements 1", date(10, Calendar.APRIL, 2001),
            date(25, Calendar.APRIL, 2001));
    st31.setPercentComplete(1.0);
    final Task st32 = new Task("Requirements 2", date(1, Calendar.MAY, 2001), date(5, Calendar.MAY, 2001));
    st32.setPercentComplete(1.0);
    t3.addSubtask(st31);
    t3.addSubtask(st32);
    s1.add(t3);

    // and another...
    final Task t4 = new Task("Design Phase", date(6, Calendar.MAY, 2001), date(30, Calendar.MAY, 2001));
    final Task st41 = new Task("Design 1", date(6, Calendar.MAY, 2001), date(10, Calendar.MAY, 2001));
    st41.setPercentComplete(1.0);
    final Task st42 = new Task("Design 2", date(15, Calendar.MAY, 2001), date(20, Calendar.MAY, 2001));
    st42.setPercentComplete(1.0);
    final Task st43 = new Task("Design 3", date(23, Calendar.MAY, 2001), date(30, Calendar.MAY, 2001));
    st43.setPercentComplete(0.50);
    t4.addSubtask(st41);
    t4.addSubtask(st42);
    t4.addSubtask(st43);
    s1.add(t4);

    final Task t5 = new Task("Design Signoff", date(2, Calendar.JUNE, 2001), date(2, Calendar.JUNE, 2001));
    s1.add(t5);

    final Task t6 = new Task("Alpha Implementation", date(3, Calendar.JUNE, 2001),
            date(31, Calendar.JULY, 2001));
    t6.setPercentComplete(0.60);

    s1.add(t6);

    final Task t7 = new Task("Design Review", date(1, Calendar.AUGUST, 2001), date(8, Calendar.AUGUST, 2001));
    t7.setPercentComplete(0.0);
    s1.add(t7);

    final Task t8 = new Task("Revised Design Signoff", date(10, Calendar.AUGUST, 2001),
            date(10, Calendar.AUGUST, 2001));
    t8.setPercentComplete(0.0);
    s1.add(t8);

    final Task t9 = new Task("Beta Implementation", date(12, Calendar.AUGUST, 2001),
            date(12, Calendar.SEPTEMBER, 2001));
    t9.setPercentComplete(0.0);
    s1.add(t9);

    final Task t10 = new Task("Testing", date(13, Calendar.SEPTEMBER, 2001), date(31, Calendar.OCTOBER, 2001));
    t10.setPercentComplete(0.0);
    s1.add(t10);

    final Task t11 = new Task("Final Implementation", date(1, Calendar.NOVEMBER, 2001),
            date(15, Calendar.NOVEMBER, 2001));
    t11.setPercentComplete(0.0);
    s1.add(t11);

    final Task t12 = new Task("Signoff", date(28, Calendar.NOVEMBER, 2001), date(30, Calendar.NOVEMBER, 2001));
    t12.setPercentComplete(0.0);
    s1.add(t12);

    final TaskSeriesCollection collection = new TaskSeriesCollection();
    collection.add(s1);

    return collection;
}

From source file:org.jfree.chart.demo.GanttDemo2.java

/**
 * Creates a sample dataset for a Gantt chart, using sub-tasks.  In general, you won't 
 * hard-code the dataset in this way - it's done here so that the demo is self-contained.
 *
 * @return The dataset.// ww w.ja  v  a 2 s.  co m
 */
private IntervalCategoryDataset createSampleDataset() {

    final TaskSeries s1 = new TaskSeries("Scheduled");

    final Task t1 = new Task("Write Proposal", date(1, Calendar.APRIL, 2001), date(5, Calendar.APRIL, 2001));
    t1.setPercentComplete(1.00);
    s1.add(t1);

    final Task t2 = new Task("Obtain Approval", date(9, Calendar.APRIL, 2001), date(9, Calendar.APRIL, 2001));
    t2.setPercentComplete(1.00);
    s1.add(t2);

    // here is a task split into two subtasks...
    final Task t3 = new Task("Requirements Analysis", date(10, Calendar.APRIL, 2001),
            date(5, Calendar.MAY, 2001));
    final Task st31 = new Task("Requirements 1", date(10, Calendar.APRIL, 2001),
            date(25, Calendar.APRIL, 2001));
    st31.setPercentComplete(1.0);
    final Task st32 = new Task("Requirements 2", date(1, Calendar.MAY, 2001), date(5, Calendar.MAY, 2001));
    st32.setPercentComplete(1.0);
    t3.addSubtask(st31);
    t3.addSubtask(st32);
    s1.add(t3);

    // and another...
    final Task t4 = new Task("Design Phase", date(6, Calendar.MAY, 2001), date(30, Calendar.MAY, 2001));
    final Task st41 = new Task("Design 1", date(6, Calendar.MAY, 2001), date(10, Calendar.MAY, 2001));
    st41.setPercentComplete(1.0);
    final Task st42 = new Task("Design 2", date(15, Calendar.MAY, 2001), date(20, Calendar.MAY, 2001));
    st42.setPercentComplete(1.0);
    final Task st43 = new Task("Design 3", date(23, Calendar.MAY, 2001), date(30, Calendar.MAY, 2001));
    st43.setPercentComplete(0.50);
    t4.addSubtask(st41);
    t4.addSubtask(st42);
    t4.addSubtask(st43);
    s1.add(t4);

    final Task t5 = new Task("Design Signoff", date(2, Calendar.JUNE, 2001), date(2, Calendar.JUNE, 2001));
    s1.add(t5);

    final Task t6 = new Task("Alpha Implementation", date(3, Calendar.JUNE, 2001),
            date(31, Calendar.JULY, 2001));
    t6.setPercentComplete(0.60);

    s1.add(t6);

    final Task t7 = new Task("Design Review", date(1, Calendar.AUGUST, 2001), date(8, Calendar.AUGUST, 2001));
    t7.setPercentComplete(0.0);
    s1.add(t7);

    final Task t8 = new Task("Revised Design Signoff", date(10, Calendar.AUGUST, 2001),
            date(10, Calendar.AUGUST, 2001));
    t8.setPercentComplete(0.0);
    s1.add(t8);

    final Task t9 = new Task("Beta Implementation", date(12, Calendar.AUGUST, 2001),
            date(12, Calendar.SEPTEMBER, 2001));
    t9.setPercentComplete(0.0);
    s1.add(t9);

    final Task t10 = new Task("Testing", date(13, Calendar.SEPTEMBER, 2001), date(31, Calendar.OCTOBER, 2001));
    t10.setPercentComplete(0.0);
    s1.add(t10);

    final Task t11 = new Task("Final Implementation", date(1, Calendar.NOVEMBER, 2001),
            date(15, Calendar.NOVEMBER, 2001));
    t11.setPercentComplete(0.0);
    s1.add(t11);

    final Task t12 = new Task("Signoff", date(28, Calendar.NOVEMBER, 2001), date(30, Calendar.NOVEMBER, 2001));
    t12.setPercentComplete(0.0);
    s1.add(t12);

    final TaskSeriesCollection collection = new TaskSeriesCollection();
    collection.add(s1);

    return collection;
}

From source file:ISO8601DateTimeFormat.java

/**
 * Write century, year, and months.// w  w  w  . ja va  2  s.  c  om
 * @param sbuf The buffer to append the string.
 */
protected final void writeCCYYMM(StringBuffer sbuf) {
    int year = calendar.get(Calendar.YEAR);
    appendInt(sbuf, year, 4);

    String month;
    switch (calendar.get(Calendar.MONTH)) {
    case Calendar.JANUARY:
        month = "-01-";
        break;
    case Calendar.FEBRUARY:
        month = "-02-";
        break;
    case Calendar.MARCH:
        month = "-03-";
        break;
    case Calendar.APRIL:
        month = "-04-";
        break;
    case Calendar.MAY:
        month = "-05-";
        break;
    case Calendar.JUNE:
        month = "-06-";
        break;
    case Calendar.JULY:
        month = "-07-";
        break;
    case Calendar.AUGUST:
        month = "-08-";
        break;
    case Calendar.SEPTEMBER:
        month = "-09-";
        break;
    case Calendar.OCTOBER:
        month = "-10-";
        break;
    case Calendar.NOVEMBER:
        month = "-11-";
        break;
    case Calendar.DECEMBER:
        month = "-12-";
        break;
    default:
        month = "-NA-";
        break;
    }
    sbuf.append(month);

    int day = calendar.get(Calendar.DAY_OF_MONTH);
    appendInt(sbuf, day, 2);
}

From source file:com.mb.framework.util.DateTimeUtil.java

/**
 * This method is used for getting month long description
 * //from   w  ww  . j  a v a  2 s  . c  o  m
 * @param mthNum
 * @return
 */
public static String getMonthLongDesc(int mthNum) {
    String mthLongDesc;

    switch (mthNum) {
    case Calendar.JANUARY: {
        mthLongDesc = DateTimeConstants.JANUARY;
        break;
    }
    case Calendar.FEBRUARY: {
        mthLongDesc = DateTimeConstants.FEBRUARY;
        break;
    }
    case Calendar.MARCH: {
        mthLongDesc = DateTimeConstants.MARCH;
        break;
    }
    case Calendar.APRIL: {
        mthLongDesc = DateTimeConstants.APRIL;
        break;
    }
    case Calendar.MAY: {
        mthLongDesc = DateTimeConstants.MAY;
        break;
    }
    case Calendar.JUNE: {
        mthLongDesc = DateTimeConstants.JUNE;
        break;
    }
    case Calendar.JULY: {
        mthLongDesc = DateTimeConstants.JULY;
        break;
    }
    case Calendar.AUGUST: {
        mthLongDesc = DateTimeConstants.AUGUST;
        break;
    }
    case Calendar.SEPTEMBER: {
        mthLongDesc = DateTimeConstants.SEPTEMBER;
        break;
    }
    case Calendar.OCTOBER: {
        mthLongDesc = DateTimeConstants.OCTOBER;
        break;
    }
    case Calendar.NOVEMBER: {
        mthLongDesc = DateTimeConstants.NOVEMBER;
        break;
    }
    case Calendar.DECEMBER: {
        mthLongDesc = DateTimeConstants.DECEMBER;
        break;
    }
    default: {
        mthLongDesc = "";
        break;
    }
    }

    return mthLongDesc;
}