Extensions
The following extensions are available globally.
-
This extension adds the capability to parse a String as an xs:duration (XML duration), returning the duration as a DateComponents Set.
The definition for duration is here: https://www.w3.org/TR/xmlschema11-2/#duration
A more readable breakdown is here: http://www.datypic.com/sc/xsd/t-xsd_duration.html
See moreDeclaration
Swift
public extension String
-
This extension provides the reverse of asXMLDuration.
You can have an instance of DateComponents express itself as a legal, optimized xs:duration String.
See moreDeclaration
Swift
public extension DateComponents