Example usage for org.joda.time YearMonthDay getMonthOfYear

List of usage examples for org.joda.time YearMonthDay getMonthOfYear

Introduction

In this page you can find the example usage for org.joda.time YearMonthDay getMonthOfYear.

Prototype

public int getMonthOfYear() 

Source Link

Document

Get the month of year field value.

Usage

From source file:com.moss.joda.time.xml.YearMonthDayAdapter.java

License:Open Source License

@Override
public String marshal(YearMonthDay object) throws Exception {
    if (object == null)
        return null;
    return object.getYear() + "-" + object.getMonthOfYear() + "-" + object.getDayOfMonth();
}

From source file:com.moss.jodapersist.YearMonthDayUserType.java

License:Open Source License

public long yearMonthDayToLong(YearMonthDay ymd) throws HibernateException {
    long l = 0;/*from  www  . j a va 2 s  .c  om*/

    l += ymd.getYear() * 10000;
    l += ymd.getMonthOfYear() * 100;
    l += ymd.getDayOfMonth();

    return l;
}

From source file:net.sourceforge.fenixedu.applicationTier.Servico.accounting.PostingRulesManager.java

License:Open Source License

@Atomic
public static void createDEAStandaloneGratuityPostingRule(StandaloneInstallmentBean bean,
        DegreeCurricularPlan degreeCurricularPlan) {
    check(AcademicPredicates.MANAGE_PAYMENTS);

    DegreeCurricularPlanServiceAgreementTemplate dcpSAT = degreeCurricularPlan.getServiceAgreementTemplate();
    if (dcpSAT != null) {
        YearMonthDay startDate = bean.getStartDate();

        LocalDate startLocalDate = new LocalDate(startDate.getYear(), startDate.getMonthOfYear(),
                startDate.getDayOfMonth());
        BigDecimal ectsForYear = bean.getEctsForYear();
        BigDecimal gratuityFactor = bean.getGratuityFactor();
        BigDecimal ectsFactor = bean.getEctsFactor();

        new StandaloneEnrolmentGratuityPR(startLocalDate.toDateTimeAtStartOfDay(), null, dcpSAT, ectsForYear,
                gratuityFactor, ectsFactor);
    } else {/*from w  w  w.j  a v a2s .  co  m*/
        throw new DomainException(
                "StandaloneEnrolmentGratuityPR.DegreeCurricularPlanServiceAgreementTemplate.cannot.be.null");
    }
}

From source file:net.sourceforge.fenixedu.dataTransferObject.InfoLessonInstanceAggregation.java

License:Open Source License

private void register(final YearMonthDay yearMonthDay) {
    dates.add(//  w ww. j  a v a 2  s.c  o m
            new LocalDate(yearMonthDay.getYear(), yearMonthDay.getMonthOfYear(), yearMonthDay.getDayOfMonth()));
}

From source file:net.sourceforge.fenixedu.dataTransferObject.manager.academicCalendarManagement.CalendarEntryBean.java

License:Open Source License

public static Partial getPartialFromYearMonthDay(YearMonthDay day) {
    return new Partial(new DateTimeFieldType[] { DateTimeFieldType.year(), DateTimeFieldType.monthOfYear() },
            new int[] { day.getYear(), day.getMonthOfYear() });
}

From source file:net.sourceforge.fenixedu.dataTransferObject.spaceManager.ViewEventSpaceOccupationsBean.java

License:Open Source License

public ViewEventSpaceOccupationsBean(YearMonthDay day, Space allocatableSpace) {

    setAllocatableSpace(allocatableSpace);

    if (day != null) {
        setYear(new Partial(DateTimeFieldType.year(), day.getYear()));
        setMonth(new Partial(DateTimeFieldType.monthOfYear(), day.getMonthOfYear()));

        YearMonthDay monday = day.toDateTimeAtMidnight().withDayOfWeek(MONDAY_IN_JODA_TIME).toYearMonthDay();
        if ((monday.getMonthOfYear() < day.getMonthOfYear()) || (monday.getYear() < day.getYear())) {
            monday = monday.plusDays(Lesson.NUMBER_OF_DAYS_IN_WEEK);
        }/*from  ww  w . ja  va2 s  . c  o  m*/

        setDay(monday);
    }
}

From source file:net.sourceforge.fenixedu.domain.accounting.Event.java

License:Open Source License

protected YearMonthDay calculateNextEndDate(final YearMonthDay yearMonthDay) {
    final YearMonthDay nextMonth = yearMonthDay.plusMonths(1);
    return new YearMonthDay(nextMonth.getYear(), nextMonth.getMonthOfYear(), 1).minusDays(1);
}

From source file:net.sourceforge.fenixedu.domain.AlumniIdentityCheckRequest.java

License:Open Source License

@Deprecated
public java.util.Date getDateOfBirth() {
    org.joda.time.YearMonthDay ymd = getDateOfBirthYearMonthDay();
    return (ymd == null) ? null
            : new java.util.Date(ymd.getYear() - 1900, ymd.getMonthOfYear() - 1, ymd.getDayOfMonth());
}

From source file:net.sourceforge.fenixedu.domain.candidacyProcess.IndividualCandidacyExternalPersonDetails.java

License:Open Source License

@Deprecated
public java.util.Date getEmissionDateOfDocumentId() {
    org.joda.time.YearMonthDay ymd = getEmissionDateOfDocumentIdYearMonthDay();
    return (ymd == null) ? null
            : new java.util.Date(ymd.getYear() - 1900, ymd.getMonthOfYear() - 1, ymd.getDayOfMonth());
}

From source file:net.sourceforge.fenixedu.domain.candidacyProcess.IndividualCandidacyExternalPersonDetails.java

License:Open Source License

@Deprecated
public java.util.Date getExpirationDateOfDocumentId() {
    org.joda.time.YearMonthDay ymd = getExpirationDateOfDocumentIdYearMonthDay();
    return (ymd == null) ? null
            : new java.util.Date(ymd.getYear() - 1900, ymd.getMonthOfYear() - 1, ymd.getDayOfMonth());
}