DateTemplates is a library that provides a simple way to generate date formatting templates that can be used to format dates in all Apple platforms and Linux. With a declarative Swift syntax that's easy to read and natural to write, DateTemplate works seamlessly with DateFormatter.
In SwiftUI, we can use it to easily format dates inline with out view code:
Text(
DateTemplate()
.dayOfWeek(.full)
.month(.abbreviated)
.day()
.time()
.localizedString(from: entry.timestamp)
)
Visit https://github.com/eneko/DateTemplates for more examples and documentation.

Top comments (0)