sbertix / Swiftagram

A modern Swift wrapper for Instagram Private API.
Apache License 2.0
249 stars 35 forks source link

timestamp.date() is return nil in Conversation.openedAt computed variable #317

Open mycroftcanner opened 9 months ago

mycroftcanner commented 9 months ago

There seems to be a problem with the timestamp to date conversion:

(lldb) p convo["lastSeenAt"].dictionary()?.compactMapValues { $0.timestamp } ([String : ComposableRequest.Wrapper]?) 2 key/value pairs { [0] = { key = "5515035060" value = { value = "1705343341533999" } } [1] = { key = "46564563340" value = { value = "1705343299192987" } } } (lldb) p convo["lastSeenAt"].dictionary()?.compactMapValues { $0.timestamp.date() } ([String : Foundation.Date]?) 0 key/value pairs

It would work with converting set to true:

(lldb) p convo["lastSeenAt"].dictionary()?.compactMapValues { $0.timestamp.date(converting: true) } ([String : Foundation.Date]?) 2 key/value pairs { [0] = (key = "46564563340", value = 2024-01-15 18:28:19 UTC) [1] = (key = "5515035060", value = 2024-01-15 18:29:01 UTC) }