From 8b85c48fc7796ba9392a7eca1561a323e307a4f8 Mon Sep 17 00:00:00 2001 From: Michael Goulet <michael@errs.io> Date: Wed, 16 Jan 2019 13:57:20 -0800 Subject: [PATCH] Explicitly set Locale.ENGLISH in DateTimeUtils Some tests were failing on my box because I've got my locale set to Portuguese; this shouldn't be an issue, since the NanoDB tests are explicitly written in English. In order to fix Date parsing language- agnostically, I just explicitly set the locale to `Locale.ENGLISH`. --- .../java/edu/caltech/nanodb/expressions/DateTimeUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/caltech/nanodb/expressions/DateTimeUtils.java b/src/main/java/edu/caltech/nanodb/expressions/DateTimeUtils.java index bd2178a..52021d7 100644 --- a/src/main/java/edu/caltech/nanodb/expressions/DateTimeUtils.java +++ b/src/main/java/edu/caltech/nanodb/expressions/DateTimeUtils.java @@ -11,6 +11,7 @@ import java.time.format.DateTimeParseException; import java.time.temporal.Temporal; import java.time.temporal.TemporalAmount; import java.util.regex.Pattern; +import java.util.Locale; /** @@ -26,8 +27,8 @@ public class DateTimeUtils { private static final DateTimeFormatter DATE_FORMATS[] = { DateTimeFormatter.ISO_LOCAL_DATE, DateTimeFormatter.BASIC_ISO_DATE, - DateTimeFormatter.ofPattern("dd MMM yyyy"), - DateTimeFormatter.ofPattern("MMM dd yyyy") + DateTimeFormatter.ofPattern("dd MMM yyyy", Locale.ENGLISH), + DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH) }; /** -- GitLab