From b296f50e28b5871764fde7dbf0648b726b91a114 Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Tue, 3 Jan 2017 23:56:11 +0100 Subject: [PATCH] - Fix ParseDateFormat --- Example/Podfile.lock | 6 +++--- Example/Pods/Local Podspecs/NSDate_Utils.podspec.json | 4 ++-- Example/Pods/Manifest.lock | 6 +++--- .../Pods/Target Support Files/NSDate_Utils/Info.plist | 2 +- .../Pods-NSDate_Utils_Example-frameworks.sh | 2 +- .../Pods-NSDate_Utils_Tests-frameworks.sh | 2 +- NSDate_Utils.podspec | 2 +- Pod/Classes/NSDate+NSDate_Util.m | 10 ++++------ 8 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 25827dc..9b046c4 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -9,7 +9,7 @@ PODS: - FBSnapshotTestCase/Core (2.1.4) - FBSnapshotTestCase/SwiftSupport (2.1.4): - FBSnapshotTestCase/Core - - NSDate_Utils (1.0.0) + - NSDate_Utils (1.0.1) - Specta (1.0.5) DEPENDENCIES: @@ -27,9 +27,9 @@ SPEC CHECKSUMS: Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516 FBSnapshotTestCase: '094f9f314decbabe373b87cc339bea235a63e07a' - NSDate_Utils: 45d47afab329001ccafe056308d0cc05460e5298 + NSDate_Utils: b451375dcbf9099a444c32de029c4498a5e7d58e Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2 PODFILE CHECKSUM: 5d3cb6429ba8613bec51b3e797c0070e91be6b26 -COCOAPODS: 1.2.0.beta.1 +COCOAPODS: 1.2.0.beta.3 diff --git a/Example/Pods/Local Podspecs/NSDate_Utils.podspec.json b/Example/Pods/Local Podspecs/NSDate_Utils.podspec.json index 4181530..1627fe1 100644 --- a/Example/Pods/Local Podspecs/NSDate_Utils.podspec.json +++ b/Example/Pods/Local Podspecs/NSDate_Utils.podspec.json @@ -1,6 +1,6 @@ { "name": "NSDate_Utils", - "version": "1.0.0", + "version": "1.0.1", "summary": "NSDate_Utils is a NSDate category that helps date managements. For example NSString to NSDate, NSDate to NSString,NSSdate comparisons", "homepage": "https://github.com/giuseppenucifora/NSDate_Utils", "license": "MIT", @@ -9,7 +9,7 @@ }, "source": { "git": "https://github.com/giuseppenucifora/NSDate_Utils.git", - "tag": "1.0.0" + "tag": "1.0.1" }, "platforms": { "ios": "7.0" diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index 25827dc..9b046c4 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -9,7 +9,7 @@ PODS: - FBSnapshotTestCase/Core (2.1.4) - FBSnapshotTestCase/SwiftSupport (2.1.4): - FBSnapshotTestCase/Core - - NSDate_Utils (1.0.0) + - NSDate_Utils (1.0.1) - Specta (1.0.5) DEPENDENCIES: @@ -27,9 +27,9 @@ SPEC CHECKSUMS: Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516 FBSnapshotTestCase: '094f9f314decbabe373b87cc339bea235a63e07a' - NSDate_Utils: 45d47afab329001ccafe056308d0cc05460e5298 + NSDate_Utils: b451375dcbf9099a444c32de029c4498a5e7d58e Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2 PODFILE CHECKSUM: 5d3cb6429ba8613bec51b3e797c0070e91be6b26 -COCOAPODS: 1.2.0.beta.1 +COCOAPODS: 1.2.0.beta.3 diff --git a/Example/Pods/Target Support Files/NSDate_Utils/Info.plist b/Example/Pods/Target Support Files/NSDate_Utils/Info.plist index 2243fe6..3c175b6 100644 --- a/Example/Pods/Target Support Files/NSDate_Utils/Info.plist +++ b/Example/Pods/Target Support Files/NSDate_Utils/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.0 + 1.0.1 CFBundleSignature ???? CFBundleVersion diff --git a/Example/Pods/Target Support Files/Pods-NSDate_Utils_Example/Pods-NSDate_Utils_Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-NSDate_Utils_Example/Pods-NSDate_Utils_Example-frameworks.sh index 1134ae4..4a7d818 100755 --- a/Example/Pods/Target Support Files/Pods-NSDate_Utils_Example/Pods-NSDate_Utils_Example-frameworks.sh +++ b/Example/Pods/Target Support Files/Pods-NSDate_Utils_Example/Pods-NSDate_Utils_Example-frameworks.sh @@ -59,7 +59,7 @@ code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then code_sign_cmd="$code_sign_cmd &" diff --git a/Example/Pods/Target Support Files/Pods-NSDate_Utils_Tests/Pods-NSDate_Utils_Tests-frameworks.sh b/Example/Pods/Target Support Files/Pods-NSDate_Utils_Tests/Pods-NSDate_Utils_Tests-frameworks.sh index 16d462c..67c7b55 100755 --- a/Example/Pods/Target Support Files/Pods-NSDate_Utils_Tests/Pods-NSDate_Utils_Tests-frameworks.sh +++ b/Example/Pods/Target Support Files/Pods-NSDate_Utils_Tests/Pods-NSDate_Utils_Tests-frameworks.sh @@ -59,7 +59,7 @@ code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then code_sign_cmd="$code_sign_cmd &" diff --git a/NSDate_Utils.podspec b/NSDate_Utils.podspec index 0881fe2..7641518 100644 --- a/NSDate_Utils.podspec +++ b/NSDate_Utils.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "NSDate_Utils" - s.version = "1.0.0" + s.version = "1.0.1" s.summary = "NSDate_Utils is a NSDate category that helps date managements. For example NSString to NSDate, NSDate to NSString,NSSdate comparisons" # This description is used to generate tags and improve search results. diff --git a/Pod/Classes/NSDate+NSDate_Util.m b/Pod/Classes/NSDate+NSDate_Util.m index f8f8476..b8caade 100755 --- a/Pod/Classes/NSDate+NSDate_Util.m +++ b/Pod/Classes/NSDate+NSDate_Util.m @@ -523,12 +523,10 @@ static NSDateFormatter *_displayFormatter = nil; [dateFormatter setDateFormat:dateFormat]; - NSDate *theDate = nil; - NSError *error = nil; - if (![dateFormatter getObjectValue:&theDate forString:dateString range:nil error:&error]) { - NSLog(@"Date '%@' could not be parsed: %@", dateString, error); - } - else { + NSDate *theDate = [NSDate dateFromString:dateString withFormat:dateFormat]; + + if (theDate) { + return dateFormat; } }