- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中net.objectlab.kit.datecalc.common.WorkingWeek.withWorkingDayFromCalendar()
方法的一些代码示例,展示了WorkingWeek.withWorkingDayFromCalendar()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkingWeek.withWorkingDayFromCalendar()
方法的具体详情如下:
包路径:net.objectlab.kit.datecalc.common.WorkingWeek
类名称:WorkingWeek
方法名:withWorkingDayFromCalendar
[英]If the value for the given day has changed, return a NEW WorkingWeek.
[中]如果给定日期的值已更改,请返回新的WorkingWeek。
代码示例来源:origin: Appendium/objectlabkit
/**
* Return a new JodaWorkingWeek if the status for the given day has changed.
*
* @param working
* true if working day
* @param givenDayOfWeek
* e.g. DateTimeConstants.MONDAY, DateTimeConstants.TUESDAY, etc
*/
public Jdk8WorkingWeek withWorkingDayFromDateTimeConstant(final boolean working, final DayOfWeek givenDayOfWeek) {
final int dayOfWeek = jdk8ToCalendarDayConstant(givenDayOfWeek);
return new Jdk8WorkingWeek(super.withWorkingDayFromCalendar(working, dayOfWeek));
}
代码示例来源:origin: net.objectlab.kit/datecalc-joda
/**
* Return a new JodaWorkingWeek if the status for the given day has changed.
*
* @param working
* true if working day
* @param givenDayOfWeek
* e.g. DateTimeConstants.MONDAY, DateTimeConstants.TUESDAY, etc
*/
public JodaWorkingWeek withWorkingDayFromDateTimeConstant(final boolean working, final int givenDayOfWeek) {
final int dayOfWeek = jodaToCalendarDayConstant(givenDayOfWeek);
return new JodaWorkingWeek(super.withWorkingDayFromCalendar(working, dayOfWeek));
}
代码示例来源:origin: Appendium/objectlabkit
/**
* Return a new JodaWorkingWeek if the status for the given day has changed.
*
* @param working
* true if working day
* @param givenDayOfWeek
* e.g. DateTimeConstants.MONDAY, DateTimeConstants.TUESDAY, etc
*/
public JodaWorkingWeek withWorkingDayFromDateTimeConstant(final boolean working, final int givenDayOfWeek) {
final int dayOfWeek = jodaToCalendarDayConstant(givenDayOfWeek);
return new JodaWorkingWeek(super.withWorkingDayFromCalendar(working, dayOfWeek));
}
代码示例来源:origin: Appendium/objectlabkit
public void testSetWorkingDayFromCalendar() {
WorkingWeek ww = new WorkingWeek();
ww = ww.withWorkingDayFromCalendar(true, Calendar.SUNDAY); // sunday
// working day
ww = ww.withWorkingDayFromCalendar(true, Calendar.SUNDAY); // sunday
// working day
// do it twice
Assert.assertTrue("Calendar.MONDAY", ww.isWorkingDayFromCalendar(Calendar.MONDAY));
Assert.assertTrue("Calendar.TUESDAY", ww.isWorkingDayFromCalendar(Calendar.TUESDAY));
Assert.assertTrue("Calendar.WEDNESDAY", ww.isWorkingDayFromCalendar(Calendar.WEDNESDAY));
Assert.assertTrue("Calendar.THURSDAY", ww.isWorkingDayFromCalendar(Calendar.THURSDAY));
Assert.assertTrue("Calendar.FRIDAY", ww.isWorkingDayFromCalendar(Calendar.FRIDAY));
Assert.assertFalse("Calendar.SATURDAY", ww.isWorkingDayFromCalendar(Calendar.SATURDAY));
Assert.assertTrue("Calendar.SUNDAY", ww.isWorkingDayFromCalendar(Calendar.SUNDAY));
ww = ww.withWorkingDayFromCalendar(false, Calendar.SUNDAY); // sunday
// working day
Assert.assertTrue("Calendar.MONDAY", ww.isWorkingDayFromCalendar(Calendar.MONDAY));
Assert.assertTrue("Calendar.TUESDAY", ww.isWorkingDayFromCalendar(Calendar.TUESDAY));
Assert.assertTrue("Calendar.WEDNESDAY", ww.isWorkingDayFromCalendar(Calendar.WEDNESDAY));
Assert.assertTrue("Calendar.THURSDAY", ww.isWorkingDayFromCalendar(Calendar.THURSDAY));
Assert.assertTrue("Calendar.FRIDAY", ww.isWorkingDayFromCalendar(Calendar.FRIDAY));
Assert.assertFalse("Calendar.SATURDAY", ww.isWorkingDayFromCalendar(Calendar.SATURDAY));
Assert.assertFalse("Calendar.SUNDAY", ww.isWorkingDayFromCalendar(Calendar.SUNDAY));
ww = ww.withWorkingDayFromCalendar(true, Calendar.SUNDAY); // sunday
// working day
// do it twice
}
代码示例来源:origin: Appendium/objectlabkit
public void testSetWorkingDayFromCalendar() {
final WorkingWeek ww = new WorkingWeek();
ww.withWorkingDayFromCalendar(true, Calendar.SUNDAY); // sunday
ww.withWorkingDayFromCalendar(true, Calendar.SUNDAY); // sunday
Assert.assertFalse("Calendar.SUNDAY", ww.isWorkingDayFromCalendar(Calendar.SUNDAY));
ww.withWorkingDayFromCalendar(false, Calendar.SUNDAY); // sunday
Assert.assertFalse("2/ Calendar.SUNDAY", ww.isWorkingDayFromCalendar(Calendar.SUNDAY));
ww.withWorkingDayFromCalendar(true, Calendar.SUNDAY); // sunday
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateIdealWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.MODIFIED_PRECEDING);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(true, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(true, Calendar.FRIDAY).withWorkingDayFromCalendar(false, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-28");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-04");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateIdealWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.FORWARD);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(true, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(true, Calendar.FRIDAY).withWorkingDayFromCalendar(false, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-08");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-08");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateIdealWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.MODIFIED_FOLLOWING);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(true, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(true, Calendar.FRIDAY).withWorkingDayFromCalendar(false, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-28");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-08");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-08");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateWhackyWeek() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.MODIFIED_FOLLOWING);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(false, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(false, Calendar.FRIDAY).withWorkingDayFromCalendar(true, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-29");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-08");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateWhackyWeek() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.FORWARD_UNLESS_MOVING_BACK);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(false, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(false, Calendar.FRIDAY).withWorkingDayFromCalendar(true, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-08");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateIdealWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.FORWARD_UNLESS_MOVING_BACK);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(true, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(true, Calendar.FRIDAY).withWorkingDayFromCalendar(false, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-08");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-08");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateIdealWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.BACKWARD);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(true, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(true, Calendar.FRIDAY).withWorkingDayFromCalendar(false, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-28");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-04");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateWhackyWeek() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.FORWARD);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(false, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(false, Calendar.FRIDAY).withWorkingDayFromCalendar(true, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-08");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateWhackyWeek() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.MODIFIED_PRECEDING);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(false, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(false, Calendar.FRIDAY).withWorkingDayFromCalendar(true, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-29");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-05");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateWhackyWeek() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.BACKWARD);
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(false, Calendar.MONDAY).withWorkingDayFromCalendar(true, Calendar.TUESDAY)
.withWorkingDayFromCalendar(false, Calendar.WEDNESDAY).withWorkingDayFromCalendar(true, Calendar.THURSDAY)
.withWorkingDayFromCalendar(false, Calendar.FRIDAY).withWorkingDayFromCalendar(true, Calendar.SATURDAY)
.withWorkingDayFromCalendar(false, Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-29");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-05");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateNoWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.MODIFIED_FOLLOWING);
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(true, Calendar.SATURDAY).withWorkingDayFromCalendar(true,
Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-31");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-06");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateNoWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.BACKWARD);
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(true, Calendar.SATURDAY).withWorkingDayFromCalendar(true,
Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-31");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-06");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateNoWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.FORWARD_UNLESS_MOVING_BACK);
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(true, Calendar.SATURDAY).withWorkingDayFromCalendar(true,
Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-31");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-06");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateNoWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.MODIFIED_PRECEDING);
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(true, Calendar.SATURDAY).withWorkingDayFromCalendar(true,
Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-31");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-06");
}
代码示例来源:origin: Appendium/objectlabkit
public void testSimpleForwardStartDateNoWeekend() {
final DateCalculator<E> cal = newDateCalculator("bla", HolidayHandlerType.FORWARD);
final WorkingWeek ww = new WorkingWeek().withWorkingDayFromCalendar(true, Calendar.SATURDAY).withWorkingDayFromCalendar(true,
Calendar.SUNDAY);
cal.setWorkingWeek(getWorkingWeek(ww));
Assert.assertEquals("Name", "bla", cal.getName());
Assert.assertEquals("Holidays size", 0, cal.getHolidayCalendar().getHolidays().size());
cal.setStartDate(newDate("2006-07-31")); // start date Monday
checkDate("start date Monday", cal, "2006-07-31");
cal.setStartDate(newDate("2006-08-01")); // start date Tuesday
checkDate("start date Tuesday", cal, "2006-08-01");
cal.setStartDate(newDate("2006-08-02")); // start date Wednesday
checkDate("start date Wednesday", cal, "2006-08-02");
cal.setStartDate(newDate("2006-08-03")); // start date Thursday
checkDate("start date Thursday", cal, "2006-08-03");
cal.setStartDate(newDate("2006-08-04")); // set on a Friday
checkDate("start date friday", cal, "2006-08-04");
cal.setStartDate(newDate("2006-08-05")); // set on a Saturday
checkDate("start date Saturday", cal, "2006-08-05");
cal.setStartDate(newDate("2006-08-06")); // set on a Sunday
checkDate("start date Sunday", cal, "2006-08-06");
}
本文整理了Java中net.objectlab.kit.datecalc.common.WorkingWeek.withWorkingDayFromCalendar()方法的一些代码示例,展示了Wor
我是一名优秀的程序员,十分优秀!