Class DateRolls

java.lang.Object
org.holiday.calendar.function.DateRolls

public final class DateRolls extends Object
Factory providing common DateRoll strategies.
Author:
Dave Joyce
  • Method Details

    • noRoll

      public static DateRoll noRoll()
      No adjustment — returns the date unchanged.
    • previousFridayOrFollowingMonday

      public static DateRoll previousFridayOrFollowingMonday()
      Saturday rolls back to Friday; Sunday rolls forward to Monday.
    • followingMonday

      public static DateRoll followingMonday()
      Saturday and Sunday both roll forward to Monday.
    • sundayToMonday

      public static DateRoll sundayToMonday()
      Only Sunday rolls forward to the following Monday; Saturday is returned unchanged (no substitute observance).

      Implements the Japanese substitute-holiday rule (振替休日): Article 3, paragraph 2 of the Act on National Holidays (国民の祝日に関する法律, 1948, amended 2007) creates a make-up Monday only when a national holiday falls on Sunday. A Saturday holiday has no substitute — it falls on an already- closed day and is returned at its natural date.

      See Also:
    • compose

      public static DateRoll compose(DateRoll first, DateRoll second)
      Compose two rolls: apply first, then apply second.