workdays-0.1.1: Workday calculations

Safe HaskellSafe
LanguageHaskell2010

Workdays

Description

 

Synopsis

Documentation

data Date Source #

A date.

Constructors

Date 

Instances

Eq Date Source # 

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Ord Date Source # 

Methods

compare :: Date -> Date -> Ordering #

(<) :: Date -> Date -> Bool #

(<=) :: Date -> Date -> Bool #

(>) :: Date -> Date -> Bool #

(>=) :: Date -> Date -> Bool #

max :: Date -> Date -> Date #

min :: Date -> Date -> Date #

Show Date Source # 

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

type Year = Integer Source #

A year.

type Month = Int Source #

A month.

type DayOfMonth = Int Source #

A day of month.

weekdays Source #

Arguments

:: Date

Start date

-> Date

End date

-> Integer 

Calculate the number of weekdays between two dates.

>>> weekdays (Date 2016 01 04) (Date 2016 01 10)
5
>>> weekdays (Date 2016 01 01) (Date 2016 12 31)
261

workdays Source #

Arguments

:: Date

Start date

-> Date

End date

-> Set Date

Dates to exclude

-> Integer 

Calculate the number of workdays between two dates.

>>> workdays (Date 2016 01 01) (Date 2016 12 31) []
261
>>> workdays (Date 2016 01 01) (Date 2016 12 31) [Date 2016 01 01]
260