From 788f1d98631d7d3717627067cff498bf21d3756a Mon Sep 17 00:00:00 2001 From: Rehan Ali Date: Fri, 3 Nov 2023 13:06:34 +0500 Subject: [PATCH] Fix error for old devices. --- .../TransformableExtention/MilliSecondsToDate.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SGSerializable/TransformableExtention/MilliSecondsToDate.swift b/Sources/SGSerializable/TransformableExtention/MilliSecondsToDate.swift index 6b4b6e9..d6f21ba 100644 --- a/Sources/SGSerializable/TransformableExtention/MilliSecondsToDate.swift +++ b/Sources/SGSerializable/TransformableExtention/MilliSecondsToDate.swift @@ -13,12 +13,12 @@ public struct MilliSecondsToDate: SGTranformable { public typealias ToType = Date public static func transform(from value: TimeInterval?) -> Date? { - guard let value else { return nil } + guard let value = value else { return nil } return Date(timeIntervalSince1970: value / 1000) } public static func transform(from value: Date?) -> TimeInterval? { - guard let value else { return nil } + guard let value = value else { return nil } return value.timeIntervalSince1970 * 1000 } }