Package java.util

Examples of java.util.GregorianCalendar.clone()


        cal.set(2001, 0, 1, 0, 0, 0);
        cal.set(Calendar.MILLISECOND, 0);
        while (cal.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
            cal.add(Calendar.DATE, 1);
        }
        this.monday = (Calendar) cal.clone();

        // calculate 9am on the first Monday after 2001-01-01
        cal.add(Calendar.HOUR, 9);
        this.monday9am = (Calendar) cal.clone();
    }
View Full Code Here


        }
        this.monday = (Calendar) cal.clone();

        // calculate 9am on the first Monday after 2001-01-01
        cal.add(Calendar.HOUR, 9);
        this.monday9am = (Calendar) cal.clone();
    }

    /**
     * Tears down the fixture, for example, close a network connection.
     * This method is called after a test is executed.
View Full Code Here

        int daysToReconnect = Integer.parseInt(daysToConnect);
       
        Calendar calLastConnection = new GregorianCalendar( tz );
        calLastConnection.setTime(lastConnectionDate);
       
        Calendar calNextConnection = (Calendar) calLastConnection.clone();
        calNextConnection.add(Calendar.DAY_OF_MONTH, daysToReconnect);
       
        Calendar calNow = new GregorianCalendar( tz );
        calNow.setTime(new Date() );
       
View Full Code Here

        {
            //This block will update day of month if it is out of bounds
            //For instance if you ask to schedule on 30th of everymonth
            //this section will set the day to 28th (or 29th) in febuary
            //as there is no 30th
            final Calendar targetMonth = (GregorianCalendar)next.clone();
            targetMonth.set( Calendar.DAY_OF_MONTH, 1 );
            targetMonth.set( Calendar.MONTH, m_month );

            final int maxDayCount = targetMonth.getActualMaximum( Calendar.DAY_OF_MONTH );
            if( maxDayCount < realDayOfMonth )
View Full Code Here

                        this.setDayOfWeek( gregoriancalendarEndDate, xcellrange,
                                           intRow, this.INT_COLUMN_END_DAY_OF_WEEK );
                       
                        // Set the initial date for the next loop
                        gregoriancalendarStartDate = ( GregorianCalendar )
                            gregoriancalendarEndDate.clone();
                       
                        // Get the due date from the table
                        String stringDueDate = this.getStringFromCell(
                            xcellrange, intRow, this.INT_COLUMN_DUEDATE );
                       
View Full Code Here

    Assert.assertNull(calendarPicker.getCalendar());

    // set a value
    final Calendar lCalendar = new GregorianCalendar(2013, 00, 01, 12, 34, 56);
    TestUtil.runThenWaitForPaintPulse( () -> {
      calendarPicker.setCalendar( (Calendar)lCalendar.clone() );
    });
    Assert.assertEquals("2013-01-01T12:34:56.000", TestUtil.quickFormatCalendarAsDateTime(calendarPicker.getCalendar()));

    // move the hour slider
    move("#hourSlider > .thumb");
View Full Code Here

      calendarPicker.setShowTime(true);
    });
    final CalendarTimePicker lCalendarTimePicker = (CalendarTimePicker)find(".CalendarTimePicker");
    TestUtil.runThenWaitForPaintPulse( () -> {
      lCalendarTimePicker.setStyle("-fxx-label-dateformat:\"HH:mm:ss\";");
      calendarPicker.setCalendar( (Calendar)lCalendar.clone() );
    });
    Assert.assertEquals("2013-01-01T12:34:56.000", TestUtil.quickFormatCalendarAsDateTime(calendarPicker.getCalendar()));

    // change date, time should not change
    click("#2013-01-02");
View Full Code Here

    request.setAttribute("maxweeks", cal.getActualMaximum(java.util.Calendar.WEEK_OF_MONTH));
    request.setAttribute("weekstart", cal.get(java.util.Calendar.DAY_OF_WEEK));
    request.setAttribute("month", month.format(date));
    request.setAttribute("maxday", df.getCalendar().getActualMaximum(java.util.Calendar.DAY_OF_MONTH));
   
    java.util.Calendar date2 = (Calendar) cal.clone();
    date2.set(Calendar.DAY_OF_MONTH, df.getCalendar().getActualMaximum(java.util.Calendar.DAY_OF_MONTH));
   
    List<Event> events = em.getEvents(cal.getTime(), date2.getTime());
   
    SimpleDateFormat sdf = new SimpleDateFormat("dd");
View Full Code Here

        {
            //This block will update day of month if it is out of bounds
            //For instance if you ask to schedule on 30th of everymonth
            //this section will set the day to 28th (or 29th) in febuary
            //as there is no 30th
            final Calendar targetMonth = (GregorianCalendar)next.clone();
            targetMonth.set( Calendar.DAY_OF_MONTH, 1 );
            targetMonth.set( Calendar.MONTH, m_month );

            final int maxDayCount = targetMonth.getActualMaximum( Calendar.DAY_OF_MONTH );
            if( maxDayCount < realDayOfMonth )
View Full Code Here

       
        // このカレンダの表示開始日を求める
        // 一度一日に戻し、それからさらにカラム番号分の日数を引く
        gc.add(Calendar.DAY_OF_MONTH, 1 - numDaysOfMonth);
        gc.add(Calendar.DAY_OF_MONTH, -firstCell);
        startDate = (GregorianCalendar) gc.clone();
       
        startDay = gc.get(Calendar.DAY_OF_MONTH);
       
        // 空のデータ配列
        data = new Object[numRows][numCols];
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.