Skip to content

Commit

Permalink
Merge pull request #12999 from woocommerce/fix/locale-issue-when-pars…
Browse files Browse the repository at this point in the history
…ing-dates-in-testbase

Fix failing ScreenshotTest in TR language
  • Loading branch information
hichamboushaba authored Nov 26, 2024
2 parents bf58aee + 72c41bb commit ddee367
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ internal class UnlocalizedDateHelper : HandlebarsHelper<Any?>() {
val localeCode: String? = options.hash("locale", "en_US_POSIX")
var date = Date()
if (offset != null) {
date = DateOffset(offset).shift(date)
// Uppercase the unit using the invariant locale as a workaround for a bug in DateOffset
val fixedOffset = offset.split(" ").let { strings ->
"${strings[0]} ${strings[1].uppercase()}"
}
date = DateOffset(fixedOffset).shift(date)
}
var locale: Locale = Locale.getDefault()
if (localeCode != null) {
Expand Down

0 comments on commit ddee367

Please sign in to comment.