Skip to content

Commit fdf81cc

Browse files
feat: DateTime is comparable
1 parent f5db0ce commit fdf81cc

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Sources/Haystack/DateTime.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,14 @@ extension DateTime {
262262
}
263263
}
264264
}
265+
266+
// DateTime + Comparable
267+
extension DateTime: Comparable {
268+
public static func < (lhs: DateTime, rhs: DateTime) -> Bool {
269+
return lhs.date < rhs.date
270+
}
271+
272+
public static func == (lhs: DateTime, rhs: DateTime) -> Bool {
273+
return lhs.date == rhs.date
274+
}
275+
}

0 commit comments

Comments
 (0)