Skip to content

Commit

Permalink
Fix date locale issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chamburr committed Jun 22, 2021
1 parent fca570b commit 91b0021
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions QLPlugin/Views/Previews/TARPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class TARPreview: Preview {
private func initDateFormatters() {
// Set default date to today to parse dates in current year
dateFormatter1.defaultDate = Date()

dateFormatter1.locale = Locale(identifier: "en_US_POSIX")
dateFormatter2.locale = Locale(identifier: "en_US_POSIX")

// Specify date formats
dateFormatter1.dateFormat = "MMM dd HH:mm"
Expand Down
1 change: 1 addition & 0 deletions QLPlugin/Views/Previews/ZIPPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ZIPPreview: Preview {
let dateFormatter = DateFormatter()

required init() {
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.dateFormat = "yy-MMM-dd HH:mm" // Date format used in `zipinfo` output
}

Expand Down

0 comments on commit 91b0021

Please sign in to comment.