16 lines
323 B
FSharp
16 lines
323 B
FSharp
module internal NightLight.Core.PartsOfDay
|
|
|
|
open System
|
|
|
|
type PartOfDay =
|
|
| Day
|
|
| Night
|
|
|
|
let getPartOfDay (dateTime: DateTime) =
|
|
match dateTime with
|
|
| _ when
|
|
dateTime.TimeOfDay >= TimeSpan.FromHours 5.5
|
|
&& dateTime.TimeOfDay < TimeSpan.FromHours 20.5
|
|
->
|
|
Day
|
|
| _ -> Night
|