本文整理汇总了Java中org.joda.time.DateMidnight.toDate方法的典型用法代码示例。如果您正苦于以下问题:Java DateMidnight.toDate方法的具体用法?Java DateMidnight.toDate怎么用?Java DateMidnight.toDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.joda.time.DateMidnight
的用法示例。
在下文中一共展示了DateMidnight.toDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ChatDateTime
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public ChatDateTime(DateTime dt) {
hour = dt.getHourOfDay();
minute = dt.getMinuteOfHour() / 5 * 5; // Arredondamento
tz = dt.getZone();
DateMidnight midnight = new DateMidnight(dt.getMillis(), tz);
date = midnight.toDate();
}
示例2: setValidFrom
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setValidFrom(DateMidnight validFrom) {
if (validFrom == null) {
this.validFrom = null;
} else {
this.validFrom = validFrom.toDate();
}
}
示例3: setApplicationDate
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setApplicationDate(DateMidnight applicationDate) {
if (applicationDate == null) {
this.applicationDate = null;
} else {
this.applicationDate = applicationDate.toDate();
}
}
示例4: setCancelDate
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setCancelDate(DateMidnight cancelDate) {
if (cancelDate == null) {
this.cancelDate = null;
} else {
this.cancelDate = cancelDate.toDate();
}
}
示例5: setEditedDate
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setEditedDate(DateMidnight editedDate) {
if (editedDate == null) {
this.editedDate = null;
} else {
this.editedDate = editedDate.toDate();
}
}
示例6: setEndDate
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setEndDate(DateMidnight endDate) {
if (endDate == null) {
this.endDate = null;
} else {
this.endDate = endDate.toDate();
}
}
示例7: setStartDate
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setStartDate(DateMidnight startDate) {
if (startDate == null) {
this.startDate = null;
} else {
this.startDate = startDate.toDate();
}
}
示例8: setRemindDate
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setRemindDate(DateMidnight remindDate) {
if (remindDate == null) {
this.remindDate = null;
} else {
this.remindDate = remindDate.toDate();
}
}
示例9: Overtime
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public Overtime(Person person, DateMidnight startDate, DateMidnight endDate, BigDecimal numberOfHours) {
Assert.notNull(person, "Person must be given.");
Assert.notNull(startDate, "Start date must be given.");
Assert.notNull(endDate, "End date must be given.");
Assert.notNull(numberOfHours, "Number of hours must be given.");
this.person = person;
this.startDate = startDate.toDate();
this.endDate = endDate.toDate();
this.hours = numberOfHours;
this.lastModificationDate = DateMidnight.now().toDate();
}
示例10: setValidTo
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setValidTo(DateMidnight validTo) {
if (validTo == null) {
this.validTo = null;
} else {
this.validTo = validTo.toDate();
}
}
示例11: ensureUpdatesRemainingVacationDaysOfHolidaysAccountIfAlreadyExists
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
@Test
public void ensureUpdatesRemainingVacationDaysOfHolidaysAccountIfAlreadyExists() {
int year = 2014;
int nextYear = 2015;
DateMidnight startDate = new DateMidnight(year, DateTimeConstants.JANUARY, 1);
DateMidnight endDate = new DateMidnight(year, DateTimeConstants.OCTOBER, 31);
BigDecimal leftDays = BigDecimal.valueOf(7);
Account referenceAccount = new Account(person, startDate.toDate(), endDate.toDate(), BigDecimal.valueOf(30),
BigDecimal.valueOf(8), BigDecimal.valueOf(4), "comment");
Account nextYearAccount = new Account(person, new DateMidnight(nextYear, 1, 1).toDate(), new DateMidnight(
nextYear, 10, 31).toDate(), BigDecimal.valueOf(28), BigDecimal.ZERO, BigDecimal.ZERO, "comment");
Mockito.when(accountService.getHolidaysAccount(nextYear, person)).thenReturn(Optional.of(nextYearAccount));
Mockito.when(vacationDaysService.calculateTotalLeftVacationDays(referenceAccount)).thenReturn(leftDays);
Account account = service.autoCreateOrUpdateNextYearsHolidaysAccount(referenceAccount);
Assert.assertNotNull("Should not be null", account);
Assert.assertEquals("Wrong person", person, account.getPerson());
Assert.assertEquals("Wrong number of annual vacation days", nextYearAccount.getAnnualVacationDays(),
account.getAnnualVacationDays());
Assert.assertEquals("Wrong number of remaining vacation days", leftDays, account.getRemainingVacationDays());
Assert.assertEquals("Wrong number of not expiring remaining vacation days", BigDecimal.ZERO,
account.getRemainingVacationDaysNotExpiring());
Assert.assertEquals("Wrong validity start date", nextYearAccount.getValidFrom(), account.getValidFrom());
Assert.assertEquals("Wrong validity end date", nextYearAccount.getValidTo(), account.getValidTo());
Mockito.verify(accountService).save(account);
Mockito.verify(vacationDaysService).calculateTotalLeftVacationDays(referenceAccount);
Mockito.verify(accountService).getHolidaysAccount(nextYear, person);
}
示例12: setAubStartDate
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setAubStartDate(DateMidnight aubStartDate) {
if (aubStartDate == null) {
this.aubStartDate = null;
} else {
this.aubStartDate = aubStartDate.toDate();
}
}
示例13: ensureCreatesNewHolidaysAccountIfNotExistsYet
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
@Test
public void ensureCreatesNewHolidaysAccountIfNotExistsYet() {
int year = 2014;
int nextYear = 2015;
DateMidnight startDate = new DateMidnight(year, DateTimeConstants.JANUARY, 1);
DateMidnight endDate = new DateMidnight(year, DateTimeConstants.OCTOBER, 31);
BigDecimal leftDays = BigDecimal.ONE;
Account referenceHolidaysAccount = new Account(person, startDate.toDate(), endDate.toDate(),
BigDecimal.valueOf(30), BigDecimal.valueOf(8), BigDecimal.valueOf(4), "comment");
Mockito.when(accountService.getHolidaysAccount(nextYear, person)).thenReturn(Optional.empty());
Mockito.when(vacationDaysService.calculateTotalLeftVacationDays(referenceHolidaysAccount)).thenReturn(leftDays);
Account createdHolidaysAccount = service.autoCreateOrUpdateNextYearsHolidaysAccount(referenceHolidaysAccount);
Assert.assertNotNull("Should not be null", createdHolidaysAccount);
Assert.assertEquals("Wrong person", person, createdHolidaysAccount.getPerson());
Assert.assertEquals("Wrong number of annual vacation days", referenceHolidaysAccount.getAnnualVacationDays(),
createdHolidaysAccount.getAnnualVacationDays());
Assert.assertEquals("Wrong number of remaining vacation days", leftDays,
createdHolidaysAccount.getRemainingVacationDays());
Assert.assertEquals("Wrong number of not expiring remaining vacation days", BigDecimal.ZERO,
createdHolidaysAccount.getRemainingVacationDaysNotExpiring());
Assert.assertEquals("Wrong validity start date", new DateMidnight(nextYear, 1, 1),
createdHolidaysAccount.getValidFrom());
Assert.assertEquals("Wrong validity end date", new DateMidnight(nextYear, 12, 31),
createdHolidaysAccount.getValidTo());
Mockito.verify(accountService).save(createdHolidaysAccount);
Mockito.verify(vacationDaysService).calculateTotalLeftVacationDays(referenceHolidaysAccount);
Mockito.verify(accountService).getHolidaysAccount(nextYear, person);
}
示例14: setLastEdited
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public void setLastEdited(DateMidnight lastEdited) {
if (lastEdited == null) {
this.lastEdited = null;
} else {
this.lastEdited = lastEdited.toDate();
}
}
示例15: createHolidaysAccount
import org.joda.time.DateMidnight; //导入方法依赖的package包/类
public static Account createHolidaysAccount(Person person, int year, BigDecimal annualVacationDays,
BigDecimal remainingVacationDays, BigDecimal remainingVacationDaysNotExpiring, String comment) {
DateMidnight firstDayOfYear = DateUtil.getFirstDayOfYear(year);
DateMidnight lastDayOfYear = DateUtil.getLastDayOfYear(year);
return new Account(person, firstDayOfYear.toDate(), lastDayOfYear.toDate(), annualVacationDays,
remainingVacationDays, remainingVacationDaysNotExpiring, comment);
}