Java Code Examples for org.joda.time.DateTime#toYearMonthDay()
The following examples show how to use
org.joda.time.DateTime#toYearMonthDay() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: fenixedu-academic File: UnitGroup.java License: GNU Lesser General Public License v3.0 | 6 votes |
@Override public boolean isMember(User user, DateTime when) { if (user == null) { return false; } YearMonthDay whenYMD = when.toYearMonthDay(); for (Accountability accountability : user.getPerson().getParentsSet()) { if (accountability.getAccountabilityType().getType() == relationType && accountability.isActive(whenYMD)) { if (accountability.getParentParty().equals(unit)) { return true; } else if (includeSubUnits && isAncestor(unit, accountability.getParentParty(), relationType, whenYMD)) { return true; } } } return false; }
Example 2
Source Project: astor File: TestGJChronology.java License: GNU General Public License v2.0 | 5 votes |
public void testSubtractDays() { // This is a test for a bug in version 1.0. The dayOfMonth range // duration field did not match the monthOfYear duration field. This // caused an exception to be thrown when subtracting days. DateTime dt = new DateTime (1112306400000L, GJChronology.getInstance(DateTimeZone.forID("Europe/Berlin"))); YearMonthDay ymd = dt.toYearMonthDay(); while (ymd.toDateTimeAtMidnight().getDayOfWeek() != DateTimeConstants.MONDAY) { ymd = ymd.minus(Period.days(1)); } }
Example 3
Source Project: astor File: TestGJChronology.java License: GNU General Public License v2.0 | 5 votes |
public void testSubtractDays() { // This is a test for a bug in version 1.0. The dayOfMonth range // duration field did not match the monthOfYear duration field. This // caused an exception to be thrown when subtracting days. DateTime dt = new DateTime (1112306400000L, GJChronology.getInstance(DateTimeZone.forID("Europe/Berlin"))); YearMonthDay ymd = dt.toYearMonthDay(); while (ymd.toDateTimeAtMidnight().getDayOfWeek() != DateTimeConstants.MONDAY) { ymd = ymd.minus(Period.days(1)); } }
Example 4
Source Project: fenixedu-academic File: ExecutionSemester.java License: GNU Lesser General Public License v3.0 | 4 votes |
public static ExecutionSemester readByDateTime(final DateTime dateTime) { final YearMonthDay yearMonthDay = dateTime.toYearMonthDay(); return readByYearMonthDay(yearMonthDay); }
Example 5
Source Project: fenixedu-academic File: FixedAmountPenaltyExemption.java License: GNU Lesser General Public License v3.0 | 4 votes |
public void init(EventExemptionJustificationType justificationType, Event event, Person responsible, String reason, DateTime dispatchDate, Money value) { setValue(value); super.init(justificationType, event, responsible, reason, dispatchDate == null ? null : dispatchDate.toYearMonthDay()); }
Example 6
Source Project: fenixedu-academic File: InsurancePR.java License: GNU Lesser General Public License v3.0 | 4 votes |
@Override public YearMonthDay getAdministrativeOfficeFeePaymentLimitDate(DateTime startDate, DateTime endDate) { return endDate.toYearMonthDay(); }
Example 7
Source Project: fenixedu-academic File: PastAdministrativeOfficeFeeAndInsurancePR.java License: GNU Lesser General Public License v3.0 | 4 votes |
public YearMonthDay getAdministrativeOfficeFeePaymentLimitDate(DateTime startDate, DateTime endDate) { return endDate.toYearMonthDay(); }