- Add More Date Format

This commit is contained in:
giuseppenuc committed 2017-01-16 14:14:33 +01:00
1 parent 9aed3ad7ba
commit 07effb57e9
7 files changed
+43 -15

No files matched your search

+18 -6
View File
@@ -42,14 +42,23 @@ static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeIT_shashSeparated
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeEN = @"MM-dd-yyyy HH:mm:ss";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeEN_shashSeparated = @"MM/dd/yyyy HH:mm:ss";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZone = @"yyyy-MM-dd'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZone_shashSeparated = @"yyyy/MM/dd'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZone_T_Separator = @"yyyy-MM-dd'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZone_T_Separator_shashSeparated = @"yyyy/MM/dd'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneEN = @"MM-dd-yyyy'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneEN_shashSeparated = @"MM/dd/yyyy'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneEN_T_Separator = @"MM-dd-yyyy'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneENAndTSeparator_shashSeparated = @"MM/dd/yyyy'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneIT = @"dd-MM-yyyy'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneIT_shashSeparated = @"dd/MM/yyyy'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneIT_T_Separator = @"dd-MM-yyyy'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneIT_T_Separator_shashSeparated = @"dd/MM/yyyy'T'HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZone = @"yyyy-MM-dd HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZone_shashSeparated = @"yyyy/MM/dd HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneEN = @"MM-dd-yyyy HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneEN_shashSeparated = @"MM/dd/yyyy HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneIT = @"dd-MM-yyyy HH:mm:ss'Z'";
static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneIT_shashSeparated = @"dd/MM/yyyy HH:mm:ss'Z'";
@interface NSDate (NSDate_Util)
@@ -82,6 +91,9 @@ static NSString * _Nonnull kNSDateHelperFormatSQLDateWithTimeZoneIT_shashSeparat
+ (NSString * _Nonnull) getUniversalHourFromDateString:(NSString * _Nonnull) string formatterString:(NSString * _Nonnull) formatterString andUppercaseString:(BOOL) uppercaseString;
+ (NSTimeInterval) timeIntervalFromMinutes:(NSUInteger) minutes;
+ (NSTimeInterval) timeIntervalFromHours:(NSUInteger) minutes;
- (NSDate * _Nonnull) dateToNearestMinutes:(NSInteger)minutes;
- (NSDate * _Nonnull) dateByAddingMinutes:(NSInteger) dMinutes;
+17 -1
View File
@@ -194,7 +194,10 @@ static NSDateFormatter *_displayFormatter = nil;
kNSDateHelperFormatSQLDateWithTimeEN_shashSeparated,kNSDateHelperFormatSQLDateWithTimeZone,
kNSDateHelperFormatSQLDateWithTimeZone_shashSeparated,kNSDateHelperFormatSQLDateWithTimeZoneEN,
kNSDateHelperFormatSQLDateWithTimeZoneEN_shashSeparated,kNSDateHelperFormatSQLDateWithTimeZoneIT,
kNSDateHelperFormatSQLDateWithTimeZoneIT_shashSeparated, nil];
kNSDateHelperFormatSQLDateWithTimeZoneIT_shashSeparated,kNSDateHelperFormatSQLDateWithTimeZone_T_Separator,
kNSDateHelperFormatSQLDateWithTimeZone_T_Separator_shashSeparated,kNSDateHelperFormatSQLDateWithTimeZoneEN_T_Separator,
kNSDateHelperFormatSQLDateWithTimeZoneENAndTSeparator_shashSeparated, kNSDateHelperFormatSQLDateWithTimeZoneIT_T_Separator,
kNSDateHelperFormatSQLDateWithTimeZoneIT_T_Separator_shashSeparated, nil];
for (NSString *dateFormat in dateFormatsArray) {
@@ -516,6 +519,19 @@ static NSDateFormatter *_displayFormatter = nil;
}
+ (NSTimeInterval) timeIntervalFromMinutes:(NSUInteger) minutes {
NSTimeInterval seconds = minutes /60;
return seconds;
}
+ (NSTimeInterval) timeIntervalFromHours:(NSUInteger) hours {
}
- (NSDate *) dateAtStartOfDay
{
NSDateComponents *components = [CURRENT_CALENDAR components:DATE_COMPONENTS fromDate:self];