Skip to content
Snippets Groups Projects
Commit 7054b3d1 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Add patern date formatter

parent 8b2dfc32
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
F6A251A7260B670000132DEC /* AppleLibs.h in Headers */ = {isa = PBXBuildFile; fileRef = F6A25199260B66FF00132DEC /* AppleLibs.h */; settings = {ATTRIBUTES = (Public, ); }; }; F6A251A7260B670000132DEC /* AppleLibs.h in Headers */ = {isa = PBXBuildFile; fileRef = F6A25199260B66FF00132DEC /* AppleLibs.h */; settings = {ATTRIBUTES = (Public, ); }; };
F6A251BA260B697300132DEC /* Double+Rounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A251B9260B697300132DEC /* Double+Rounded.swift */; }; F6A251BA260B697300132DEC /* Double+Rounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A251B9260B697300132DEC /* Double+Rounded.swift */; };
F6A251BE260B699100132DEC /* String+Html.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A251BD260B699100132DEC /* String+Html.swift */; }; F6A251BE260B699100132DEC /* String+Html.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A251BD260B699100132DEC /* String+Html.swift */; };
F6A504582800D8CC00D22549 /* PatternDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A504572800D8CC00D22549 /* PatternDateFormatter.swift */; };
F6A70E14275D445300C2FB00 /* Date+Create.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A70E13275D445300C2FB00 /* Date+Create.swift */; }; F6A70E14275D445300C2FB00 /* Date+Create.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A70E13275D445300C2FB00 /* Date+Create.swift */; };
F6CCA30A276FC53D00844F92 /* Logging in Frameworks */ = {isa = PBXBuildFile; productRef = F6CCA309276FC53D00844F92 /* Logging */; }; F6CCA30A276FC53D00844F92 /* Logging in Frameworks */ = {isa = PBXBuildFile; productRef = F6CCA309276FC53D00844F92 /* Logging */; };
F6CD575026D246470051B38E /* Float+Rounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6CD574F26D246470051B38E /* Float+Rounded.swift */; }; F6CD575026D246470051B38E /* Float+Rounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6CD574F26D246470051B38E /* Float+Rounded.swift */; };
...@@ -76,6 +77,7 @@ ...@@ -76,6 +77,7 @@
F6A251B2260B680F00132DEC /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; }; F6A251B2260B680F00132DEC /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
F6A251B9260B697300132DEC /* Double+Rounded.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Double+Rounded.swift"; sourceTree = "<group>"; }; F6A251B9260B697300132DEC /* Double+Rounded.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Double+Rounded.swift"; sourceTree = "<group>"; };
F6A251BD260B699100132DEC /* String+Html.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Html.swift"; sourceTree = "<group>"; }; F6A251BD260B699100132DEC /* String+Html.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Html.swift"; sourceTree = "<group>"; };
F6A504572800D8CC00D22549 /* PatternDateFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PatternDateFormatter.swift; sourceTree = "<group>"; };
F6A70E13275D445300C2FB00 /* Date+Create.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+Create.swift"; sourceTree = "<group>"; }; F6A70E13275D445300C2FB00 /* Date+Create.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+Create.swift"; sourceTree = "<group>"; };
F6CD574F26D246470051B38E /* Float+Rounded.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Float+Rounded.swift"; sourceTree = "<group>"; }; F6CD574F26D246470051B38E /* Float+Rounded.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Float+Rounded.swift"; sourceTree = "<group>"; };
F6EDE73527B461030030F810 /* CoreData+Extended.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreData+Extended.swift"; sourceTree = "<group>"; }; F6EDE73527B461030030F810 /* CoreData+Extended.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreData+Extended.swift"; sourceTree = "<group>"; };
...@@ -171,6 +173,7 @@ ...@@ -171,6 +173,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
F68C2D412616482A00042967 /* IsoDateFormatter.swift */, F68C2D412616482A00042967 /* IsoDateFormatter.swift */,
F6A504572800D8CC00D22549 /* PatternDateFormatter.swift */,
F623A67A2635B5F900F50371 /* Date+Styled.swift */, F623A67A2635B5F900F50371 /* Date+Styled.swift */,
F6A70E13275D445300C2FB00 /* Date+Create.swift */, F6A70E13275D445300C2FB00 /* Date+Create.swift */,
); );
...@@ -376,6 +379,7 @@ ...@@ -376,6 +379,7 @@
F673A9962635EF510017AD37 /* ResponseError.swift in Sources */, F673A9962635EF510017AD37 /* ResponseError.swift in Sources */,
F673A9992635EF510017AD37 /* RequestBuilder.swift in Sources */, F673A9992635EF510017AD37 /* RequestBuilder.swift in Sources */,
F6EDE73727B461030030F810 /* CoreData+Extended.swift in Sources */, F6EDE73727B461030030F810 /* CoreData+Extended.swift in Sources */,
F6A504582800D8CC00D22549 /* PatternDateFormatter.swift in Sources */,
F6A70E14275D445300C2FB00 /* Date+Create.swift in Sources */, F6A70E14275D445300C2FB00 /* Date+Create.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
......
//
// PatternDateFormatter.swift
// AppleLibs
//
// Created by Tobias on 08.04.22.
//
import Foundation
public extension DateFormatter
{
static func pattern(_ pattern: String) -> DateFormatter {
let formatter = DateFormatter()
formatter.dateFormat = pattern
formatter.calendar = Calendar(identifier: .iso8601)
formatter.timeZone = TimeZone(secondsFromGMT: 0)
return formatter
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment