Package java.util

Examples of java.util.GregorianCalendar.before()


                        if ( !stringDueDate.equals( "" ) ) {
                            GregorianCalendar gregoriancalendarDueDate =
                                this.getGregorianCalendarFromString( stringDueDate );
                           
                            // Testing if the due date is before the calculated end date
                            if ( gregoriancalendarDueDate.before( gregoriancalendarEndDate ) ) {
                                /* Getting the date when the processing of the feature/bug should
                                   be started at the latest */
                                GregorianCalendar gregoriancalendarLatestDateToStart =
                                    this.getWorkday( gregoriancalendarDueDate,
                                                     -( intNeededDays - 1 ),
View Full Code Here


                        System.err.println("Invalid time argument.");
                        return null;
                    }
                    GregorianCalendar currentDate = new GregorianCalendar();
                    GregorianCalendar shutdownDate = new GregorianCalendar(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DATE), Integer.parseInt(strings[0]), Integer.parseInt(strings[1]));
                    if (shutdownDate.before(currentDate)) {
                        shutdownDate.set(Calendar.DATE, shutdownDate.get(Calendar.DATE) + 1);
                    }
                    sleep = shutdownDate.getTimeInMillis() - currentDate.getTimeInMillis();
                }
            }
View Full Code Here

        }
       
       
        ModuleSchedulerMessage message = new ModuleSchedulerMessageImpl();

        if (lastSessionDate.before(todayDate)) {
          message.setSessionStartAllowed(true);
            return message;
        } else if (!lastSessionDate.before(todayDate)) {
          message.setSessionStartAllowed(false);
          message.setMessageTitle("Tatool");
View Full Code Here

        ModuleSchedulerMessage message = new ModuleSchedulerMessageImpl();

        if (lastSessionDate.before(todayDate)) {
          message.setSessionStartAllowed(true);
            return message;
        } else if (!lastSessionDate.before(todayDate)) {
          message.setSessionStartAllowed(false);
          message.setMessageTitle("Tatool");
          int hours = (23 - lastSessionDate.get(Calendar.HOUR_OF_DAY));
          int minutes = (60 - lastSessionDate.get(Calendar.MINUTE));
          StringBuilder mb = new StringBuilder();
View Full Code Here

          message.setMessageText("Sie d�rfen nur 26 Einheiten von diesem Modul absolvieren.");
          return message;
        }
       
        // Allow a total of 26 session and only one session a day (before and after midnight)
        if (lastSessionDate.before(todayDate) && numSessions < 26) {
            return message;
        } else {
            return message;
        }
    }
View Full Code Here

    }
    if (type == Calendar.YEAR) {
      gc1.clear(Calendar.MONTH);
      gc2.clear(Calendar.MONTH);
    }
    while (gc1.before(gc2)) {
      gc1.add(type, 1);
      elapsed++;
    }
    return elapsed;
  }
View Full Code Here

                            GregorianCalendar gregCalDueDate =
                                this.getGregorianCalendarFromString(sDueDate);
                           
                            // Testing if the due date is before the calculated
                            // end date
                            if ( gregCalDueDate.before(
                                     gregCalEndDate ) ) {
                                /* Getting the date when the processing of the
                                   feature/bug should
                                   be started at the latest */
                                GregorianCalendar gregCalLatestDateToStart =
View Full Code Here

        assertEquals("/Upload", gpxType.getMetadata().getKeywords());

        Calendar expectedCal = Calendar.getInstance();
        GregorianCalendar actualCal = gpxType.getMetadata().getTime().toGregorianCalendar();
        actualCal.setTimeZone(expectedCal.getTimeZone());
        assertTrue(actualCal.before(expectedCal));

        assertEquals(1, gpxType.getRte().size());
        RteType rteType = gpxType.getRte().get(0);
        assertEquals(Integer.toString(routeKey), rteType.getName());
        assertEquals("Description" + fileKey, rteType.getDesc());
View Full Code Here

    // Test leap year if current year is a leap year
    public void testFeb29IfLeapYear() throws Exception{
        GregorianCalendar now = new GregorianCalendar();
        final int thisYear = now.get(Calendar.YEAR);
        if (now.isLeapYear(thisYear) && now.before(new GregorianCalendar(thisYear,Calendar.AUGUST,29))){
            GregorianCalendar target = new GregorianCalendar(thisYear,Calendar.FEBRUARY,29);           
            checkShortParse("Feb 29th",now,target);
        } else {
            System.out.println("Skipping Feb 29 test");
        }
View Full Code Here

    // Test leap year if current year is a leap year
    public void testFeb29IfLeapYear() throws Exception{
        GregorianCalendar now = new GregorianCalendar();
        final int thisYear = now.get(Calendar.YEAR);
        if (now.isLeapYear(thisYear) && now.before(new GregorianCalendar(thisYear,Calendar.AUGUST,29))){
            GregorianCalendar target = new GregorianCalendar(thisYear,Calendar.FEBRUARY,29);           
            checkShortParse("Feb 29th",now,target);
        } else {
            System.out.println("Skipping Feb 29 test");
        }
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.