本文整理汇总了Java中java.time.DayOfWeek.SUNDAY属性的典型用法代码示例。如果您正苦于以下问题:Java DayOfWeek.SUNDAY属性的具体用法?Java DayOfWeek.SUNDAY怎么用?Java DayOfWeek.SUNDAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.DayOfWeek
的用法示例。
在下文中一共展示了DayOfWeek.SUNDAY属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderDayItem
/**
* Creates a node for a given day. Styling should be done via CSS, but
* appropriate CSS classes are assigned to each node.
* @param date A given date the node is associated with.
* @return A node that displays the day of month.
*/
private Node renderDayItem(LocalDate date) {
Label lblDate = new Label(""+date.getDayOfMonth());
lblDate.getStyleClass().add("daychooser-day");
if(date.getDayOfWeek() == DayOfWeek.SATURDAY
|| date.getDayOfWeek() == DayOfWeek.SUNDAY) {
lblDate.getStyleClass().add("daychooser-weekend");
} else {
lblDate.getStyleClass().add("daychooser-weekday");
}
if(date.equals(selectedDateProperty.get())) {
lblDate.getStyleClass().add("daychooser-selected-day");
}
if(date.equals(LocalDate.now())) {
lblDate.getStyleClass().add("daychooser-current-day");
}
return lblDate;
}
示例2: data_week
@DataProvider(name="IsoWeekData")
Object[][] data_week() {
return new Object[][] {
{LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
{LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
{LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
{LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
{LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
{LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
{LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
{LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
{LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
{LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
{LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
{LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
};
}
示例3: isWeekday
public DayAssert isWeekday() {
DayOfWeek day = actual.getDayOfWeek();
if (day == DayOfWeek.SATURDAY || day == DayOfWeek.SUNDAY) {
failWithMessage("Expected weekday but was <%s>", actual.getDayOfWeek());
}
return this;
}
示例4: of
/**
* Obtains an instance of {@code WeekDefinition} appropriate for a locale.
* <p>
* This will look up appropriate values from the provider of localization data.
*
* @param locale the locale to use, not null
* @return the week-definition, not null
*/
public static WeekDefinition of(Locale locale) {
Jdk7Methods.Objects_requireNonNull(locale, "locale");
DayOfWeek dow = DayOfWeek.MONDAY;
if ("US".equals(locale.getCountry())) {
dow = DayOfWeek.SUNDAY;
}
int minDays = 4; // ISO-08601 // gcal.getMinimalDaysInFirstWeek();
return WeekDefinition.of(dow, minDays);
}
示例5: providerDayOfWeekData
@DataProvider(name="parseDayOfWeekText")
Object[][] providerDayOfWeekData() {
return new Object[][] {
// Locale, pattern, input text, expected DayOfWeek
{Locale.US, "e", "1", DayOfWeek.SUNDAY},
{Locale.US, "ee", "01", DayOfWeek.SUNDAY},
{Locale.US, "c", "1", DayOfWeek.SUNDAY},
{Locale.UK, "e", "1", DayOfWeek.MONDAY},
{Locale.UK, "ee", "01", DayOfWeek.MONDAY},
{Locale.UK, "c", "1", DayOfWeek.MONDAY},
};
}
示例6: providerDayOfWeekData
@DataProvider(name="print_DayOfWeekData")
Object[][] providerDayOfWeekData() {
return new Object[][] {
// Locale, pattern, expected text, input DayOfWeek
{Locale.US, "e", "1", DayOfWeek.SUNDAY},
{Locale.US, "ee", "01", DayOfWeek.SUNDAY},
{Locale.US, "c", "1", DayOfWeek.SUNDAY},
{Locale.UK, "e", "1", DayOfWeek.MONDAY},
{Locale.UK, "ee", "01", DayOfWeek.MONDAY},
{Locale.UK, "c", "1", DayOfWeek.MONDAY},
};
}
示例7: providerDayOfWeekData
@DataProvider(name="parseDayOfWeekText")
Object[][] providerDayOfWeekData() {
return new Object[][] {
// Locale, pattern, input text, expected DayOfWeek
{Locale.US, "e", "1", DayOfWeek.SUNDAY},
{Locale.US, "ee", "01", DayOfWeek.SUNDAY},
{Locale.US, "c", "1", DayOfWeek.SUNDAY},
};
}
示例8: providerDayOfWeekData
@DataProvider(name="print_DayOfWeekData")
Object[][] providerDayOfWeekData() {
return new Object[][] {
// Locale, pattern, expected text, input DayOfWeek
{Locale.US, "e", "1", DayOfWeek.SUNDAY},
{Locale.US, "ee", "01", DayOfWeek.SUNDAY},
{Locale.US, "c", "1", DayOfWeek.SUNDAY},
};
}
示例9: isWeekend
public boolean isWeekend(LocalDate date) {
DayOfWeek day = date.getDayOfWeek();
return day == DayOfWeek.SATURDAY || day == DayOfWeek.SUNDAY;
}
示例10: isWeekend
public static boolean isWeekend(LocalDate date) {
return date.getDayOfWeek() == DayOfWeek.SATURDAY
|| date.getDayOfWeek() == DayOfWeek.SUNDAY;
}
示例11: isSlowTickDate
private static boolean isSlowTickDate() {
return LocalDate.now().getDayOfWeek() == DayOfWeek.SATURDAY
|| LocalDate.now().getDayOfWeek() == DayOfWeek.SUNDAY;
}
示例12: isOpeningDay
/**
* Check if date is opening day for a specific mensa
* @param date
* @param mensa
* @return true if is opening day, false otherwise
*/
public boolean isOpeningDay(LocalDate date, Mensa mensa) {
DayOfWeek firstDayClosed = config.isMensaOpenOnSaturday(mensa) ? DayOfWeek.SUNDAY : DayOfWeek.SATURDAY;
return date.getDayOfWeek().compareTo(firstDayClosed) < 0 && !HOLIDAY_MANAGER.isHoliday(date);
}