Holidays v0.2.4 Holidays.DateCalculator.WeekendModifier View Source

Link to this section Summary

Functions

Move date to Monday if it occurs on a Sunday.

Move date to Monday if it occurs on a Saturday or Sunday.

Move date to Monday if it occurs on a Sunday or to Friday if it occurs on a Saturday.

Link to this section Functions

Link to this function

to_monday_if_sunday(date)

View Source

Move date to Monday if it occurs on a Sunday.

Examples

iex> Holidays.DateCalculator.WeekendModifier.to_monday_if_sunday({2015,12,5})
{2015,12,5}

iex> Holidays.DateCalculator.WeekendModifier.to_monday_if_sunday({2015,12,6})
{2015,12,7}

iex> Holidays.DateCalculator.WeekendModifier.to_monday_if_sunday({2015,12,8})
{2015,12,8}
Link to this function

to_monday_if_weekend(date)

View Source

Move date to Monday if it occurs on a Saturday or Sunday.

Examples

iex> Holidays.DateCalculator.WeekendModifier.to_monday_if_weekend({2015,12,5})
{2015,12,7}

iex> Holidays.DateCalculator.WeekendModifier.to_monday_if_weekend({2015,12,6})
{2015,12,7}

iex> Holidays.DateCalculator.WeekendModifier.to_monday_if_weekend({2015,12,8})
{2015,12,8}
Link to this function

to_weekday_if_weekend(date)

View Source

Move date to Monday if it occurs on a Sunday or to Friday if it occurs on a Saturday.

Examples

iex> Holidays.DateCalculator.WeekendModifier.to_weekday_if_weekend({2015,12,5})
{2015,12,4}

iex> Holidays.DateCalculator.WeekendModifier.to_weekday_if_weekend({2015,12,6})
{2015,12,7}

iex> Holidays.DateCalculator.WeekendModifier.to_weekday_if_weekend({2015,12,8})
{2015,12,8}