Skip to content

Commit 17c0903

Browse files
committed
fix: correct time deserialization format annotation placement
1 parent b2d1b58 commit 17c0903

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/com/github/khakers/modmailviewer/data/Message.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
public final class Message implements Comparable<Message> {
1414
private final String id;
1515

16-
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateFormatters.PYTHON_STR_ISO_OFFSET_DATE_TIME_STRING, timezone = "UTC", locale = "en")
1716
private final Instant creationTime;
1817
private final String content;
1918
private final List<Attachment> attachments;
@@ -49,6 +48,7 @@ public final class Message implements Comparable<Message> {
4948
public Message(
5049
@JsonProperty("message_id") String id,
5150
@JsonProperty("timestamp")
51+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateFormatters.PYTHON_STR_ISO_OFFSET_DATE_TIME_STRING, timezone = "UTC")
5252
Instant creationTime,
5353
@JsonProperty("content") String content,
5454
@JsonProperty("attachments") List<Attachment> attachments,

src/main/java/com/github/khakers/modmailviewer/util/DateFormatters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class DateFormatters {
3232
.withChronology(IsoChronology.INSTANCE)
3333
.withZone(ZoneId.of("UTC"));
3434

35-
public static final String PYTHON_STR_ISO_OFFSET_DATE_TIME_STRING = "yyyy-MM-dd HH:mm[:ss[.n]][XXX]";
35+
public static final String PYTHON_STR_ISO_OFFSET_DATE_TIME_STRING = "uuuu-MM-dd HH:mm[:ss[.n]][XXX]";
3636
public static final DateTimeFormatter SIMPLE_TIME_FORMAT = new DateTimeFormatterBuilder()
3737
.appendPattern("HH:mm a")
3838
.toFormatter()

0 commit comments

Comments
 (0)