Skip to content

Commit

Permalink
Revert "Fixed #306"
Browse files Browse the repository at this point in the history
This reverts commit 332902e.
  • Loading branch information
malcommac committed Oct 18, 2016
1 parent 332902e commit bd5ad20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/SwiftDate/DateTimeInterval.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ public struct DateTimeInterval : Comparable {
///
/// - precondition: `end >= start`
public init(start: Date, end: Date) {
if end < start {
fatalError("Reverse intervals are not allowed")
}

self.start = start
duration = start.timeIntervalSince(end)
duration = end.timeIntervalSince(start)
}

/// Initialize a `DateTimeInterval` with the specified start date and duration.
Expand Down

0 comments on commit bd5ad20

Please sign in to comment.