List of usage examples for org.joda.time DateTimeConstants JUNE
int JUNE
To view the source code for org.joda.time DateTimeConstants JUNE.
Click Source Link
From source file:com.axelor.apps.base.service.scheduler.SchedulerService.java
License:Open Source License
/** * Mthode qui dtermine la prochaine date d'xcution d'un planificateur pour un rythme annuel * * @param scheduler//w w w .ja v a 2s .c o m * Instance de planificateur * @param date * Derniere date d'xcution thorique * * @return LocalDate * Prochaine date d'xcution */ private LocalDate getAnnualComputeDate(Scheduler scheduler, LocalDate date) { int monthOfYear = 0; if (scheduler.getMonthAnnuallySelect().equals(IAdministration.JAN)) monthOfYear = DateTimeConstants.JANUARY; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.FEB)) monthOfYear = DateTimeConstants.FEBRUARY; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.MAR)) monthOfYear = DateTimeConstants.MARCH; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.APR)) monthOfYear = DateTimeConstants.APRIL; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.MAY)) monthOfYear = DateTimeConstants.MAY; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.JUN)) monthOfYear = DateTimeConstants.JUNE; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.JUL)) monthOfYear = DateTimeConstants.JULY; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.AUG)) monthOfYear = DateTimeConstants.AUGUST; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.SEP)) monthOfYear = DateTimeConstants.SEPTEMBER; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.OCT)) monthOfYear = DateTimeConstants.OCTOBER; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.NOV)) monthOfYear = DateTimeConstants.NOVEMBER; else if (scheduler.getMonthAnnuallySelect().equals(IAdministration.DEC)) monthOfYear = DateTimeConstants.DECEMBER; if (monthOfYear != 0) { int start = date.plusWeeks(scheduler.getWeekWeekly()).dayOfMonth().getMinimumValue(); int end = date.plusWeeks(scheduler.getWeekWeekly()).dayOfMonth().getMaximumValue(); if (start <= scheduler.getDayAnnually() && scheduler.getDayAnnually() <= end) return date.plusYears(scheduler.getYearAnnually()).withMonthOfYear(monthOfYear) .withDayOfMonth(scheduler.getDayAnnually()); else if (scheduler.getDayMonthly() < start) return date.plusYears(scheduler.getYearAnnually()).withMonthOfYear(monthOfYear).dayOfMonth() .withMinimumValue(); else if (scheduler.getDayMonthly() > end) return date.plusYears(scheduler.getYearAnnually()).withMonthOfYear(monthOfYear).dayOfMonth() .withMaximumValue(); } return null; }
From source file:com.fourmob.datetimepicker.Utils.java
License:Open Source License
public static int getDaysInMonth(final int month, final int year) { switch (month) { default:// w ww .j a va2 s . com throw new IllegalArgumentException("Invalid Month"); case DateTimeConstants.JANUARY: case DateTimeConstants.MARCH: case DateTimeConstants.MAY: case DateTimeConstants.JULY: case DateTimeConstants.AUGUST: case DateTimeConstants.OCTOBER: case DateTimeConstants.DECEMBER: return 31; case DateTimeConstants.APRIL: case DateTimeConstants.JUNE: case DateTimeConstants.SEPTEMBER: case DateTimeConstants.NOVEMBER: return 30; case DateTimeConstants.FEBRUARY: if ((year % 4) == 0) { return 29; } return 28; } }
From source file:com.helger.datetime.holiday.mgr.XMLUtil.java
License:Apache License
/** * Returns the {@link DateTimeConstants} value for the given month. * /* w ww . j av a2 s .c o m*/ * @param eMonth * Month of year to convert * @return {@link DateTimeConstants} value. */ @Nonnegative public static int getMonth(@Nonnull final Month eMonth) { switch (eMonth) { case JANUARY: return DateTimeConstants.JANUARY; case FEBRUARY: return DateTimeConstants.FEBRUARY; case MARCH: return DateTimeConstants.MARCH; case APRIL: return DateTimeConstants.APRIL; case MAY: return DateTimeConstants.MAY; case JUNE: return DateTimeConstants.JUNE; case JULY: return DateTimeConstants.JULY; case AUGUST: return DateTimeConstants.AUGUST; case SEPTEMBER: return DateTimeConstants.SEPTEMBER; case OCTOBER: return DateTimeConstants.OCTOBER; case NOVEMBER: return DateTimeConstants.NOVEMBER; case DECEMBER: return DateTimeConstants.DECEMBER; default: throw new IllegalArgumentException("Unknown month " + eMonth); } }
From source file:com.jjlharrison.jollyday.util.XMLUtil.java
License:Apache License
/** * Returns the <code>DateTimeConstants</code> value for the given month. * * @param month/* w w w .j a va 2 s .com*/ * a {@link com.jjlharrison.config.Month} object. * @return DateTimeConstants value. */ public int getMonth(Month month) { switch (month) { case JANUARY: return DateTimeConstants.JANUARY; case FEBRUARY: return DateTimeConstants.FEBRUARY; case MARCH: return DateTimeConstants.MARCH; case APRIL: return DateTimeConstants.APRIL; case MAY: return DateTimeConstants.MAY; case JUNE: return DateTimeConstants.JUNE; case JULY: return DateTimeConstants.JULY; case AUGUST: return DateTimeConstants.AUGUST; case SEPTEMBER: return DateTimeConstants.SEPTEMBER; case OCTOBER: return DateTimeConstants.OCTOBER; case NOVEMBER: return DateTimeConstants.NOVEMBER; case DECEMBER: return DateTimeConstants.DECEMBER; default: throw new IllegalArgumentException("Unknown month " + month); } }
From source file:ee.ut.soras.ajavtV2.util.SemDefValjadeParsija.java
License:Open Source License
/** * Tagastab s6nele vastava konstandi klassist <tt>org.joda.time.DateTimeConstants</tt>. */// ww w.j ava 2s . co m public static int parseValueFromConstant(String dateTimeConstant) { // ------------------- AM_PM ------------------------ if (dateTimeConstant.equals("AM")) { return DateTimeConstants.AM; } if (dateTimeConstant.equals("PM")) { return DateTimeConstants.PM; } // ------------------- Nadalapaevad ------------------------ if (dateTimeConstant.equals("MONDAY")) { return DateTimeConstants.MONDAY; } if (dateTimeConstant.equals("TUESDAY")) { return DateTimeConstants.TUESDAY; } if (dateTimeConstant.equals("WEDNESDAY")) { return DateTimeConstants.WEDNESDAY; } if (dateTimeConstant.equals("THURSDAY")) { return DateTimeConstants.THURSDAY; } if (dateTimeConstant.equals("FRIDAY")) { return DateTimeConstants.FRIDAY; } if (dateTimeConstant.equals("SATURDAY")) { return DateTimeConstants.SATURDAY; } if (dateTimeConstant.equals("SUNDAY")) { return DateTimeConstants.SUNDAY; } // --------------------- Kuud ------------------------------ if (dateTimeConstant.equals("JANUARY")) { return DateTimeConstants.JANUARY; } if (dateTimeConstant.equals("FEBRUARY")) { return DateTimeConstants.FEBRUARY; } if (dateTimeConstant.equals("MARCH")) { return DateTimeConstants.MARCH; } if (dateTimeConstant.equals("APRIL")) { return DateTimeConstants.APRIL; } if (dateTimeConstant.equals("MAY")) { return DateTimeConstants.MAY; } if (dateTimeConstant.equals("JUNE")) { return DateTimeConstants.JUNE; } if (dateTimeConstant.equals("JULY")) { return DateTimeConstants.JULY; } if (dateTimeConstant.equals("AUGUST")) { return DateTimeConstants.AUGUST; } if (dateTimeConstant.equals("SEPTEMBER")) { return DateTimeConstants.SEPTEMBER; } if (dateTimeConstant.equals("OCTOBER")) { return DateTimeConstants.OCTOBER; } if (dateTimeConstant.equals("NOVEMBER")) { return DateTimeConstants.NOVEMBER; } if (dateTimeConstant.equals("DECEMBER")) { return DateTimeConstants.DECEMBER; } return Integer.MIN_VALUE; }
From source file:org.kemri.wellcome.dhisreport.api.utils.QuarterlyPeriod.java
License:Open Source License
/** * TODO: Probably more efficient ways to do this. But this is least cryptic * @param date //from w ww . ja v a 2 s.c om */ public QuarterlyPeriod(Date date) { DateTime dt = new DateTime(date); int monthNum = dt.getMonthOfYear(); if (monthNum >= 1 && monthNum <= 3) { startDate = dt.withMonthOfYear(DateTimeConstants.JANUARY).dayOfMonth().withMinimumValue().toDate(); endDate = dt.withMonthOfYear(DateTimeConstants.MARCH).dayOfMonth().withMaximumValue() .withTime(23, 59, 59, 999).toDate(); } else if (monthNum >= 4 && monthNum <= 6) { startDate = dt.withMonthOfYear(DateTimeConstants.APRIL).dayOfMonth().withMinimumValue().toDate(); endDate = dt.withMonthOfYear(DateTimeConstants.JUNE).dayOfMonth().withMaximumValue() .withTime(23, 59, 59, 999).toDate(); } else if (monthNum >= 7 && monthNum <= 9) { startDate = dt.withMonthOfYear(DateTimeConstants.JULY).dayOfMonth().withMinimumValue().toDate(); endDate = dt.withMonthOfYear(DateTimeConstants.SEPTEMBER).dayOfMonth().withMaximumValue() .withTime(23, 59, 59, 999).toDate(); } else if (monthNum >= 10 && monthNum <= 12) { startDate = dt.withMonthOfYear(DateTimeConstants.OCTOBER).dayOfMonth().withMinimumValue().toDate(); endDate = dt.withMonthOfYear(DateTimeConstants.DECEMBER).dayOfMonth().withMaximumValue() .withTime(23, 59, 59, 999).toDate(); } }