From a4436fd844232976285edcdd4c7a2af8d38f3e19 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Tue, 19 Mar 2019 21:15:32 -0500 Subject: [PATCH] Added "as of" date display logic --- src/PrayerTracker.UI/Resources/Common.es.resx | 3 +++ src/PrayerTracker.UI/ViewModels.fs | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/PrayerTracker.UI/Resources/Common.es.resx b/src/PrayerTracker.UI/Resources/Common.es.resx index 2f3f9eb..cfb46e0 100644 --- a/src/PrayerTracker.UI/Resources/Common.es.resx +++ b/src/PrayerTracker.UI/Resources/Common.es.resx @@ -819,4 +819,7 @@ Visualización de la Fecha “Como de” + + como de + \ No newline at end of file diff --git a/src/PrayerTracker.UI/ViewModels.fs b/src/PrayerTracker.UI/ViewModels.fs index 071f22d..750bdc7 100644 --- a/src/PrayerTracker.UI/ViewModels.fs +++ b/src/PrayerTracker.UI/ViewModels.fs @@ -579,7 +579,8 @@ with (this.date - req.updatedDate).Days <= this.listGroup.preferences.daysToKeepNew /// Generate this list as HTML member this.asHtml (s : IStringLocalizer) = - let prefs = this.listGroup.preferences + let prefs = this.listGroup.preferences + let asOfSize = Math.Round (float prefs.textFontSize * 0.8, 2) [ match this.showHeader with | true -> yield div [ _style (sprintf "text-align:center;font-family:%s" prefs.listFonts) ] [ @@ -626,6 +627,18 @@ with | Some _ -> () | None -> () yield rawText req.text + match prefs.asOfDateDisplay with + | NoDisplay -> () + | ShortDate + | LongDate -> + let dt = + match prefs.asOfDateDisplay with + | ShortDate -> req.updatedDate.ToShortDateString () + | LongDate -> req.updatedDate.ToLongDateString () + | _ -> "" + yield i [ _style (sprintf "font-size:%fpt" asOfSize) ] [ + rawText "  ("; str s.["as of "].Value; str dt; rawText ")" + ] ]) |> ul [] yield br []