List of usage examples for org.joda.time LocalDateTime getMonthOfYear
public int getMonthOfYear()
From source file:org.odk.collect.android.fragments.dialogs.BikramSambatDatePickerDialog.java
License:Apache License
private void setUpDatePicker() { LocalDateTime localDateTime = getDate(); try {// w ww . j a v a2 s. c o m BikramSambatDate bikramSambatDate = BsCalendar.getInstance().toBik(localDateTime.getYear(), localDateTime.getMonthOfYear(), localDateTime.getDayOfMonth()); setUpDayPicker(bikramSambatDate.day, BsCalendar.getInstance().daysInMonth(bikramSambatDate.year, bikramSambatDate.month)); setUpMonthPicker(bikramSambatDate.month, monthsArray); setUpYearPicker(bikramSambatDate.year, MIN_SUPPORTED_YEAR, MAX_SUPPORTED_YEAR); } catch (BsException e) { Timber.e(e); } }
From source file:org.odk.collect.android.fragments.dialogs.CopticDatePickerDialog.java
License:Apache License
private void setUpDatePicker() { LocalDateTime copticDate = DateTimeUtils.skipDaylightSavingGapIfExists(getDate()).toDateTime() .withChronology(CopticChronology.getInstance()).toLocalDateTime(); setUpDayPicker(copticDate.getDayOfMonth(), copticDate.dayOfMonth().getMaximumValue()); setUpMonthPicker(copticDate.getMonthOfYear(), monthsArray); setUpYearPicker(copticDate.getYear(), MIN_SUPPORTED_YEAR, MAX_SUPPORTED_YEAR); }
From source file:org.odk.collect.android.fragments.dialogs.EthiopianDatePickerDialog.java
License:Apache License
private void setUpDatePicker() { LocalDateTime ethiopianDate = DateTimeUtils.skipDaylightSavingGapIfExists(getDate()).toDateTime() .withChronology(EthiopicChronology.getInstance()).toLocalDateTime(); setUpDayPicker(ethiopianDate.getDayOfMonth(), ethiopianDate.dayOfMonth().getMaximumValue()); setUpMonthPicker(ethiopianDate.getMonthOfYear(), monthsArray); setUpYearPicker(ethiopianDate.getYear(), MIN_SUPPORTED_YEAR, MAX_SUPPORTED_YEAR); }
From source file:org.odk.collect.android.fragments.dialogs.IslamicDatePickerDialog.java
License:Apache License
private void setUpDatePicker() { LocalDateTime islamicDate = DateTimeUtils.skipDaylightSavingGapIfExists(getDate()).toDateTime() .withChronology(IslamicChronology.getInstance()).toLocalDateTime(); setUpDayPicker(islamicDate.getDayOfMonth(), islamicDate.dayOfMonth().getMaximumValue()); setUpMonthPicker(islamicDate.getMonthOfYear(), monthsArray); setUpYearPicker(islamicDate.getYear(), MIN_SUPPORTED_YEAR, MAX_SUPPORTED_YEAR); }
From source file:org.pidome.server.services.macros.Macro.java
License:Apache License
/** * Returns the last occurrence of the actions taken. * @return //from w w w . j ava 2 s. c o m */ public final String getLastOccurrence() { if (lastOccurrenceTime == 0) { return "Never"; } else { DateTime dt = new DateTime(new Date(lastOccurrenceTime)); LocalDateTime ldt = dt.toLocalDateTime(); return TimeUtils.compose24Hours(ldt.getHourOfDay(), ldt.getMinuteOfHour()) + " " + TimeUtils.composeDDMMYYYYDate(ldt.getDayOfMonth(), ldt.getMonthOfYear(), ldt.getYear()); } }
From source file:playground.johannes.gsv.synPop.invermo.Date2TimeTask.java
License:Open Source License
private LocalDateTime getReference(String date) { LocalDateTime dateTime = SplitPlanTask.formatter.parseLocalDateTime(date); return new LocalDateTime(dateTime.getYear(), dateTime.getMonthOfYear(), dateTime.getDayOfMonth(), 0, 0); }
From source file:propel.core.utils.ConversionUtils.java
License:Open Source License
/** * Converts a Joda LocalDateTime object to an XML Gregorian Calendar data type *///w ww.j a v a2 s .com @Validate public static XMLGregorianCalendar toXMLGregorianCalendar(@NotNull final LocalDateTime value) throws DatatypeConfigurationException { val gc = new GregorianCalendar(value.getYear(), value.getMonthOfYear() - 1, value.getDayOfMonth(), value.getHourOfDay(), value.getMinuteOfHour(), value.getSecondOfMinute()); gc.set(Calendar.MILLISECOND, value.getMillisOfSecond()); return DatatypeFactory.newInstance().newXMLGregorianCalendar(gc); }
From source file:qunar.tc.qmq.delay.store.log.ScheduleOffsetResolver.java
License:Apache License
private static long month(final LocalDateTime localDateTime) { return localDateTime.getMonthOfYear() * 1000000L; }
From source file:uk.co.onehp.trickle.services.betfair.ScheduledServiceImpl.java
License:Open Source License
private String nextBetSchedule() { LocalDateTime nextBetTime = this.domainService.getNextBetTime(); if (null == nextBetTime) { nextBetTime = new LocalDateTime().plusMinutes(1); }// w ww. ja v a2 s. co m String cron = String.format("%s %s %s %s %s ?", nextBetTime.getSecondOfMinute(), nextBetTime.getMinuteOfHour(), nextBetTime.getHourOfDay(), nextBetTime.getDayOfMonth(), nextBetTime.getMonthOfYear()); return cron; }
From source file:uk.co.onehp.trickle.services.betfair.ScheduledServiceImpl.java
License:Open Source License
private String nextBetPriceSchedule() { LocalDateTime nextBetTime = this.domainService.getNextBetTime(); if (null == nextBetTime) { nextBetTime = new LocalDateTime().plusMinutes(1); } else {/* w ww. ja v a 2 s. com*/ nextBetTime = nextBetTime.minusSeconds(this.upcomingBetsSeconds); } String cron = String.format("%s %s %s %s %s ?", nextBetTime.getSecondOfMinute(), nextBetTime.getMinuteOfHour(), nextBetTime.getHourOfDay(), nextBetTime.getDayOfMonth(), nextBetTime.getMonthOfYear()); return cron; }