on master help sign in
Fixed date bug in example
commit4d67b188f6a5636737254569f05d8b4ed4441da0 authoriko <mail@iko.soy> dateFri 16 Jun 2023, 22:37 (3 years ago) parent39ecaf6
2 files changed+2−3
example/src/Main.elm+1−2 src/Ur/Da.elm+1−1
example/src/Main.elm+1−2
@@ -11,7 +11,6 @@ import Time
1111import Ur
1212import Ur.Cmd
1313import Ur.Constructor as C
14−import Ur.Da
1514import Ur.Deconstructor as D
1615import Ur.Requests
1716import Ur.Run
@@ -149,7 +148,7 @@ update msg model =
149148 { ship = "~zod"
150149 , agent = "journal"
151150 , mark = "journal-action"
152− , noun = C.cell (C.cord "add") (C.cell (Ur.Da.posixToDa time |> C.bigint) (C.cord txt))
151+ , noun = C.cell (C.cord "add") (C.cell (time |> Time.posixToMillis |> BigInt.fromInt |> C.bigint) (C.cord txt))
153152 }
154153 |> RunCmd
155154 )
src/Ur/Da.elm+1−1
@@ -20,4 +20,4 @@ second =
2020
2121posixToDa : Posix -> Da
2222posixToDa p =
23− BigInt.add (BigInt.div (BigInt.mul (BigInt.fromInt (Time.posixToMillis p)) second) (BigInt.fromInt 1000)) unixEpochStart
23+ BigInt.add (BigInt.div (BigInt.mul (BigInt.fromInt (Time.posixToMillis p)) second) (BigInt.fromInt 1000000)) unixEpochStart