Skip to content

Commit

Permalink
Merge pull request MatthewYork#200 from harysutanto/master
Browse files Browse the repository at this point in the history
Remove optionals from all date format functions
  • Loading branch information
MatthewYork authored Mar 4, 2017
2 parents d6356d9 + 4809b78 commit 6a04846
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions DateToolsSwift/DateTools/Date+Format.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public extension Date {
*
* - returns: Represenation of the date (self) in the specified format
*/
public func format(with dateStyle: DateFormatter.Style, timeZone: TimeZone, locale: Locale) -> String? {
public func format(with dateStyle: DateFormatter.Style, timeZone: TimeZone, locale: Locale) -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = dateStyle
dateFormatter.timeZone = timeZone
Expand All @@ -41,7 +41,7 @@ public extension Date {
*
* - returns String? - Represenation of the date (self) in the specified format
*/
public func format(with dateStyle: DateFormatter.Style, timeZone: TimeZone) -> String? {
public func format(with dateStyle: DateFormatter.Style, timeZone: TimeZone) -> String {
#if os(Linux)
return format(with: dateStyle, timeZone: timeZone, locale: Locale.current)
#else
Expand All @@ -58,7 +58,7 @@ public extension Date {
*
* - returns: Represenation of the date (self) in the specified format
*/
public func format(with dateStyle: DateFormatter.Style, locale: Locale) -> String? {
public func format(with dateStyle: DateFormatter.Style, locale: Locale) -> String {
return format(with: dateStyle, timeZone: TimeZone.autoupdatingCurrent, locale: locale)
}

Expand All @@ -70,7 +70,7 @@ public extension Date {
*
* - returns: Represenation of the date (self) in the specified format
*/
public func format(with dateStyle: DateFormatter.Style) -> String? {
public func format(with dateStyle: DateFormatter.Style) -> String {
#if os(Linux)
return format(with: dateStyle, timeZone: TimeZone.autoupdatingCurrent, locale: Locale.current)
#else
Expand All @@ -90,7 +90,7 @@ public extension Date {
*
* - returns: Represenation of the date (self) in the specified format
*/
public func format(with dateFormat: String, timeZone: TimeZone, locale: Locale) -> String? {
public func format(with dateFormat: String, timeZone: TimeZone, locale: Locale) -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = dateFormat
dateFormatter.timeZone = timeZone
Expand All @@ -108,7 +108,7 @@ public extension Date {
*
* - returns: Representation of the date (self) in the specified format
*/
public func format(with dateFormat: String, timeZone: TimeZone) -> String? {
public func format(with dateFormat: String, timeZone: TimeZone) -> String {
#if os(Linux)
return format(with: dateFormat, timeZone: timeZone, locale: Locale.current)
#else
Expand All @@ -125,7 +125,7 @@ public extension Date {
*
* - returns: Represenation of the date (self) in the specified format
*/
public func format(with dateFormat: String, locale: Locale) -> String? {
public func format(with dateFormat: String, locale: Locale) -> String {
return format(with: dateFormat, timeZone: TimeZone.autoupdatingCurrent, locale: locale)
}

Expand All @@ -137,7 +137,7 @@ public extension Date {
*
* - returns: Represenation of the date (self) in the specified format
*/
public func format(with dateFormat: String) -> String? {
public func format(with dateFormat: String) -> String {
#if os(Linux)
return format(with: dateFormat, timeZone: TimeZone.autoupdatingCurrent, locale: Locale.current)
#else
Expand Down

0 comments on commit 6a04846

Please sign in to comment.