Skip to content

Commit

Permalink
Merge pull request #251 from keithxun/branch-date-locale
Browse files Browse the repository at this point in the history
Add locale for date format
  • Loading branch information
yuvrajaryan authored Nov 12, 2024
2 parents 1ec7bb2 + 9b0e0d7 commit d5dbcda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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})$");

Expand Down

0 comments on commit d5dbcda

Please sign in to comment.