open System.Globalization
let private culture = CultureInfo.InvariantCulture
let mfi = culture.DateTimeFormat
|> List.map (fun n -> n, mfi.GetMonthName n)
|> List.mapi (fun i m -> pown 2 i, m)
let firstDay year month =
let lastDay = culture.Calendar.GetDaysInMonth(year, month)
DateTime(year, month, lastDay)
let findConsecutives xs =
| (y::xs)::xss when y - x <= 1 -> (x::y::xs)::xss
List.foldBack collect xs []
type Range = { Start: System.DateTime; Ende: System.DateTime }
let extractRange year months =
{ Start = List.head ls |> Calendar.firstDay year
Ende = Seq.last ls |> Calendar.lastDay year })
Calendar.extractMonths 910