Skip to content

Commit

Permalink
Added isLenient flag to formatter as a possible fix to nil initiators…
Browse files Browse the repository at this point in the history
… when using a daylight savings change date
  • Loading branch information
melvitax committed Oct 20, 2017
1 parent fcdbd2f commit adfba47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AFDateHelper.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AFDateHelper"
s.version = "4.2.5"
s.version = "4.2.6"
s.summary = "Date Extension for Swift 4.0"
s.description = <<-DESC
A Swift Date extension for creating, modifying and comparing dates.
Expand Down
4 changes: 3 additions & 1 deletion Sources/DateHelper.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// AFDateHelper.swift
// https://github.com/melvitax/DateHelper
// Version 4.2.5
// Version 4.2.6
//
// Created by Melvin Rivera on 7/15/14.
// Copyright (c) 2014. All rights reserved.
Expand Down Expand Up @@ -502,6 +502,7 @@ public extension Date {
formatter.dateFormat = format
formatter.timeZone = timeZone
formatter.locale = locale
formatter.isLenient = true
Date.cachedDateFormatters[hashKey] = formatter
}
return Date.cachedDateFormatters[hashKey]!
Expand All @@ -517,6 +518,7 @@ public extension Date {
formatter.doesRelativeDateFormatting = doesRelativeDateFormatting
formatter.timeZone = timeZone
formatter.locale = locale
formatter.isLenient = true
Date.cachedDateFormatters[hashKey] = formatter
}
return Date.cachedDateFormatters[hashKey]!
Expand Down

1 comment on commit adfba47

@melvitax
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresses #66

Please sign in to comment.