From 5e98f9f5106cca2ca2307fbfc5c9a22fd3fe29f6 Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Tue, 1 Mar 2016 11:32:18 +0100 Subject: [PATCH] - Add more date formats --- Example/Podfile | 4 ++-- NSDate_Utils.podspec | 2 +- Pod/Classes/NSDate+NSDate_Util.h | 21 ++++++++++++++++----- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Example/Podfile b/Example/Podfile index 2afc826..4b4e488 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,11 +1,11 @@ source 'https://github.com/CocoaPods/Specs.git' use_frameworks! -target 'NSDate_Utils_Example', :exclusive => true do +target 'NSDate_Utils_Example' do pod "NSDate_Utils", :path => "../" end -target 'NSDate_Utils_Tests', :exclusive => true do +target 'NSDate_Utils_Tests' do pod "NSDate_Utils", :path => "../" pod 'Specta' diff --git a/NSDate_Utils.podspec b/NSDate_Utils.podspec index e12ce4c..b025930 100644 --- a/NSDate_Utils.podspec +++ b/NSDate_Utils.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "NSDate_Utils" - s.version = "0.1.0" + s.version = "0.1.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.h b/Pod/Classes/NSDate+NSDate_Util.h index fe7662d..ef14924 100755 --- a/Pod/Classes/NSDate+NSDate_Util.h +++ b/Pod/Classes/NSDate+NSDate_Util.h @@ -21,17 +21,28 @@ static NSString *kNSDateHelperFormatWeekday = @"EEEE"; static NSString *kNSDateHelperFormatWeekdayWithTime = @"EEEE h:mm a"; static NSString *kNSDateHelperFormatTime = @"h:mm a"; static NSString *kNSDateHelperFormatTimeWithPrefix = @"'at' h:mm a"; -static NSString *kNSDateHelperFormatSQLDate = @"yyyy-MM-dd"; + static NSString *kNSDateHelperFormatSQLTime = @"HH:mm:ss"; -static NSString *kNSDateHelperFormatSQLDateWithTime = @"yyyy-MM-dd HH:mm:ss"; + +static NSString *kNSDateHelperFormatSQLDate = @"yyyy-MM-dd"; static NSString *kNSDateHelperFormatSQLDate_shashSeparated = @"yyyy/MM/dd"; -static NSString *kNSDateHelperFormatSQLDate_notSlashSeparated = @"yyyy-MM-dd"; -static NSString *kNSDateHelperFormatSQLDateWithTime_shashSeparated = @"yyyy/MM/dd HH:mm:ss"; +static NSString *kNSDateHelperFormatSQLDate_notSlashSeparated = @"yyyy-MM-dd"; + static NSString *kNSDateHelperFormatSQLDateIT = @"dd-MM-yyyy"; -static NSString *kNSDateHelperFormatSQLDateEN = @"MM-dd-yyyy"; static NSString *kNSDateHelperFormatSQLDateIT_shashSeparated = @"dd/MM/yyyy"; + +static NSString *kNSDateHelperFormatSQLDateEN = @"MM-dd-yyyy"; static NSString *kNSDateHelperFormatSQLDateEN_shashSeparated = @"MM/dd/yyyy"; +static NSString *kNSDateHelperFormatSQLDateWithTime = @"yyyy-MM-dd HH:mm:ss"; +static NSString *kNSDateHelperFormatSQLDateWithTime_shashSeparated = @"yyyy/MM/dd HH:mm:ss"; + +static NSString *kNSDateHelperFormatSQLDateWithTimeIT = @"dd-MM-yyyy HH:mm:ss"; +static NSString *kNSDateHelperFormatSQLDateWithTimeIT_shashSeparated = @"dd/MM/yyyy HH:mm:ss"; + +static NSString *kNSDateHelperFormatSQLDateWithTimeEN = @"MM-dd-yyyy HH:mm:ss"; +static NSString *kNSDateHelperFormatSQLDateWithTimeEN_shashSeparated = @"MM/dd/yyyy HH:mm:ss"; + @interface NSDate (NSDate_Util) + (void)initializeStatics;