aboutsummaryrefslogtreecommitdiff
path: root/Aamukampa.Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'Aamukampa.Frontend')
-rw-r--r--Aamukampa.Frontend/App.fs25
1 files changed, 18 insertions, 7 deletions
diff --git a/Aamukampa.Frontend/App.fs b/Aamukampa.Frontend/App.fs
index 8c69d29..d388013 100644
--- a/Aamukampa.Frontend/App.fs
+++ b/Aamukampa.Frontend/App.fs
@@ -1,6 +1,7 @@
open System
open Browser.Dom
open Aamukampa.Core
+open Falco.Markup
DateTime.Now
|> printfn "It is %O"
@@ -8,13 +9,23 @@ DateTime.Now
let k = kontingent 2 2025
let st = ThreeFourSeven
-let currentTime =
- // DateTime(2025, 7, 5)
- // DateTime(2026, 6, 18)
- // DateTime(2026, 6, 17)
- DateTime.Today
- // DateTime.Now
- // Domain.getStartDate k |> Option.get
+window.setInterval((fun () ->
+ let now = DateTime.Now
+ let tjElement = document.getElementById "tj"
+ let currentTj =
+ match Int32.TryParse(tjElement.innerText) with
+ | true, tj -> Some tj
+ | false, _ -> None
+ document.getElementById "time-units"
+ |> fun el ->
+ el.outerHTML <-
+ Views.Main.timeUnits {
+ TimeLeft = Domain.getTimeLeft k st now |> Option.get
+ TimeCompleted = Domain.getTimeCompleted k now |> Option.get
+ } |> renderHtml
+ ()),
+ 1000, [||])
+ |> ignore
// currentTime
// |> Domain.getTimeLeft k st