WIP on update to .NET 8 (#75)
This commit is contained in:
@@ -29,7 +29,7 @@ let noResults heading link buttonText text =
|
||||
|
||||
/// Create a date with a span tag, displaying the relative date with the full date/time in the tooltip
|
||||
let relativeDate (date : Instant) now (tz : DateTimeZone) =
|
||||
span [ _title (date.InZone(tz).ToDateTimeOffset().ToString ("f", null)) ] [ Dates.formatDistance now date |> str ]
|
||||
span [ _title (date.InZone(tz).ToDateTimeOffset().ToString("f", null)) ] [ Dates.formatDistance now date |> str ]
|
||||
|
||||
/// The version of myPrayerJournal
|
||||
let version =
|
||||
|
||||
@@ -74,13 +74,13 @@ let snoozed now tz reqs =
|
||||
|
||||
/// View for Full Request page
|
||||
let full (clock : IClock) tz (req : Request) =
|
||||
let now = clock.GetCurrentInstant ()
|
||||
let now = clock.GetCurrentInstant()
|
||||
let answered =
|
||||
req.History
|
||||
|> Seq.ofList
|
||||
|> Seq.filter History.isAnswered
|
||||
|> Seq.tryHead
|
||||
|> Option.map (fun x -> x.AsOf)
|
||||
|> Option.map (_.AsOf)
|
||||
let prayed = (req.History |> List.filter History.isPrayed |> List.length).ToString "N0"
|
||||
let daysOpen =
|
||||
let asOf = defaultArg answered now
|
||||
@@ -89,7 +89,7 @@ let full (clock : IClock) tz (req : Request) =
|
||||
req.History
|
||||
|> Seq.ofList
|
||||
|> Seq.filter (fun h -> Option.isSome h.Text)
|
||||
|> Seq.sortByDescending (fun h -> h.AsOf)
|
||||
|> Seq.sortByDescending (_.AsOf)
|
||||
|> Seq.map (fun h -> Option.get h.Text)
|
||||
|> Seq.head
|
||||
// The history log including notes (and excluding the final entry for answered requests)
|
||||
@@ -100,7 +100,7 @@ let full (clock : IClock) tz (req : Request) =
|
||||
|> Seq.ofList
|
||||
|> Seq.map (fun n -> {| asOf = n.AsOf; text = Some n.Notes; status = "Notes" |})
|
||||
|> Seq.append (req.History |> List.map toDisp)
|
||||
|> Seq.sortByDescending (fun it -> it.asOf)
|
||||
|> Seq.sortByDescending (_.asOf)
|
||||
|> List.ofSeq
|
||||
// Skip the first entry for answered requests; that info is already displayed
|
||||
match answered with Some _ -> all.Tail | None -> all
|
||||
@@ -112,7 +112,7 @@ let full (clock : IClock) tz (req : Request) =
|
||||
match answered with
|
||||
| Some date ->
|
||||
str "Answered "
|
||||
date.ToDateTimeOffset().ToString ("D", null) |> str
|
||||
date.ToDateTimeOffset().ToString("D", null) |> str
|
||||
str " ("
|
||||
relativeDate date now tz
|
||||
rawText ") • "
|
||||
@@ -127,7 +127,7 @@ let full (clock : IClock) tz (req : Request) =
|
||||
p [ _class "m-0" ] [
|
||||
str it.status
|
||||
rawText " "
|
||||
small [] [ em [] [ it.asOf.ToDateTimeOffset().ToString ("D", null) |> str ] ]
|
||||
small [] [ em [] [ it.asOf.ToDateTimeOffset().ToString("D", null) |> str ] ]
|
||||
]
|
||||
match it.text with
|
||||
| Some txt -> p [ _class "mt-2 mb-0" ] [ str txt ]
|
||||
|
||||
Reference in New Issue
Block a user