本文整理匯總了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);
}