From aa426cde756c5cb2dfb503f1b38e9eccd827f518 Mon Sep 17 00:00:00 2001 From: keithxun Date: Tue, 12 Nov 2024 10:11:53 +0800 Subject: [PATCH 1/2] Add locale for date format --- .../java/hallpointer/address/model/session/SessionDate.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/hallpointer/address/model/session/SessionDate.java b/src/main/java/hallpointer/address/model/session/SessionDate.java index a0b8543b205..b5d772618e6 100644 --- a/src/main/java/hallpointer/address/model/session/SessionDate.java +++ b/src/main/java/hallpointer/address/model/session/SessionDate.java @@ -6,6 +6,7 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; +import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -21,7 +22,8 @@ public class SessionDate { + "Example: 24 Sep 2024"; // Desired date format - public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("dd MMM yyyy"); + public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("dd MMM yyyy") + .localizedBy(Locale.ENGLISH); // Whitespace processing already done earlier public static final Pattern PARSING_PATTERN = Pattern.compile("^([0-9]{1,2}) ([a-zA-Z]{3}) ([0-9]{4})$"); From 9b0e0d7151a69b7affc97263cda180ffc6108d76 Mon Sep 17 00:00:00 2001 From: keithxun Date: Tue, 12 Nov 2024 10:14:38 +0800 Subject: [PATCH 2/2] Minor fix to DeveloperGuide --- docs/DeveloperGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 6e5197acd10..826daf109ae 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -155,7 +155,7 @@ The `Storage` component has the following responsibilities: It inherits from both `Storage` and `UserPrefStorage`, allowing it to be treated as either one, depending on the functionality needed. -- Depends on some classes in the `Model` component, as its job is to save and retrieve objects that belong to the `Model`. +It depends on some classes in the `Model` component, as its job is to save and retrieve objects that belong to the `Model`. ---