Skip to content

Commit ea6736d

Browse files
committed
fix unpackFactor timezone cases
1 parent 00f1567 commit ea6736d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.19.1"
3+
version = "0.19.2"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/services/Serialization.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ function getStandardZDTString(stringTimestamp::String)
6868
# This is finding :59Z or :59.82-05:00 and fixing it to always have 3 subsecond digits.
6969
# Temporary fix until TimeZones.jl gets an upstream fix.
7070
return replace(ts, r":\d\d(\.\d+)?(Z|z|\+|-)" => _fixSubseconds)
71+
# if occursin(r".*\:\d\d\+", packedProps["timestamp"])
72+
# ZonedDateTime(packedProps["timestamp"], "yyyy-mm-ddTHH:MM:SSzzzz")
73+
# elseif occursin(r".*\:\d\d\.", packedProps["timestamp"])
74+
# ZonedDateTime(packedProps["timestamp"], "yyyy-mm-ddTHH:MM:SS.sss+zzzz")
75+
# else
76+
# ZonedDateTime(packedProps["timestamp"])
77+
# end
7178
end
7279

7380
# Corrects any `::ZonedDateTime` fields of T in corresponding `interm::Dict` as `dateformat"yyyy-mm-ddTHH:MM:SS.ssszzz"`
@@ -658,6 +665,8 @@ function unpackFactor(
658665
UUID(packedProps["id"]) else nothing end
659666
label = packedProps["label"]
660667

668+
# various formats in which the timestamp might be stored
669+
packedProps["timestamp"] = getStandardZDTString(packedProps["timestamp"])
661670
timestamp = ZonedDateTime(packedProps["timestamp"])
662671
nstime = Nanosecond(get(packedProps, "nstime", 0))
663672

0 commit comments

Comments
 (0)