Skip to content

Commit

Permalink
Add date formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-albers committed Oct 3, 2021
1 parent dfab0d8 commit 5df9bf6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/TripKit/TripKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class TripKit {

public let hhmmFormatter = DateFormatter()
public let ddmmhhmmFormatter = DateFormatter()
public let ddmmyyyyFormatter = DateFormatter()
public let multilineWeekDayFormatter = DateFormatter()
public let weekDayFormatter = DateFormatter()

Expand All @@ -20,6 +21,9 @@ public class TripKit {
ddmmhhmmFormatter.dateFormat = (DateFormatter.dateFormat(fromTemplate: "ddMM", options: 0, locale: locale) ?? "dd.MM") + "', '" + hhmmFormatter.dateFormat
ddmmhhmmFormatter.locale = locale

ddmmyyyyFormatter.dateFormat = (DateFormatter.dateFormat(fromTemplate: "ddMMyyyy", options: 0, locale: locale) ?? "dd.MM.yyyy")
ddmmyyyyFormatter.locale = locale

multilineWeekDayFormatter.dateFormat = (DateFormatter.dateFormat(fromTemplate: "EEEddMM", options: 0, locale: locale) ?? "EEE', 'dd.MM") + "'\n'" + hhmmFormatter.dateFormat
multilineWeekDayFormatter.locale = locale

Expand Down

0 comments on commit 5df9bf6

Please sign in to comment.