Skip to content

Commit

Permalink
More date formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
prof18 committed Apr 14, 2024
1 parent 74490d2 commit 85ea241
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ class DateFormatter(
dayOfWeek(DayOfWeekNames.ENGLISH_ABBREVIATED)
chars(", ")
}
dayOfMonth(Padding.NONE)
alternativeParsing({
dayOfMonth()
}) {
dayOfMonth(Padding.NONE)
}
char(' ')
monthName(MonthNames.ENGLISH_ABBREVIATED)
char(' ')
Expand All @@ -91,6 +95,12 @@ class DateFormatter(
optional {
chars("CDT")
}
optional {
chars("PDT")
}
optional {
chars("PST")
}
},

// "2023-12-13 19:34:30 +0800"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class DateFormatterTest {
"2024-04-08 07:09:09 +0800",
"Thu, 22 Jun 2023",
"Tue, 19 Mar 2024 06:00 -0400",
"Sat, 13 Apr 2024 06:00:00 PDT",
"Sat, 13 Apr 2024 06:00:00 PST"
)

@Test
Expand Down

0 comments on commit 85ea241

Please sign in to comment.