Created
April 17, 2023 12:44
-
-
Save michaelevensen/2084e74017adf2691ee4c4b3dfd264d6 to your computer and use it in GitHub Desktop.
Date / duration formatting with the new `.formatted()` API in Swift.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text((startDate..<endDate).formatted(.components(style: .wide)).capitalized) | |
Text(endDate.formatted(.relative(presentation: .numeric, unitsStyle: .spellOut))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment