Skip to content

Commit 163d8d3

Browse files
committed
refactor: renamed DateAndTimeFormatter to Formatters
BREAKING CHANGE: com.onixbyte.webcal.config.DateAndTimeFormatter is being moved to com.onixbyte.webcal.config.Formatters
1 parent 9c63a33 commit 163d8d3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

webcal/src/main/java/com/onixbyte/webcal/config/DateAndTimeFormatter.java renamed to webcal/src/main/java/com/onixbyte/webcal/config/Formatters.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @author Zihlu Wang
2828
*/
29-
public final class DateAndTimeFormatter {
29+
public final class Formatters {
3030

3131
/**
3232
* Get the {@link java.time.format.DateTimeFormatter datetime formatter}
@@ -45,4 +45,10 @@ public static DateTimeFormatter getUtcDatetimeFormatter() {
4545

4646
private static DateTimeFormatter utcDateTimeFormatter;
4747

48+
/**
49+
* Private constructor to prevent this class being initialised.
50+
*/
51+
private Formatters() {
52+
}
53+
4854
}

webcal/src/main/java/com/onixbyte/webcal/impl/WebCalendarEvent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import com.onixbyte.webcal.WebCalendarNode;
2121
import com.onixbyte.webcal.config.Classification;
22-
import com.onixbyte.webcal.config.DateAndTimeFormatter;
22+
import com.onixbyte.webcal.config.Formatters;
2323

2424
import java.text.MessageFormat;
2525
import java.time.Duration;
@@ -269,8 +269,8 @@ public String resolve() {
269269
END:{0}""",
270270
/* 0 - tag */TAG,
271271
/* 1 - uid */ Optional.ofNullable(uid).orElse(UUID.randomUUID().toString()) + "@" + domainName,
272-
/* 2 - dtstamp */ now.format(DateAndTimeFormatter.getUtcDatetimeFormatter()),
273-
/* 3 - start time */ start.atZone(ZoneId.systemDefault()).format(DateAndTimeFormatter.getUtcDatetimeFormatter()),
272+
/* 2 - dtstamp */ now.format(Formatters.getUtcDatetimeFormatter()),
273+
/* 3 - start time */ start.atZone(ZoneId.systemDefault()).format(Formatters.getUtcDatetimeFormatter()),
274274
/* 4 - summary */ Optional.ofNullable(summary).map((item) -> "\nSUMMARY:" + item).orElse(""),
275275
/* 5 - categories */ Optional.ofNullable(categories)
276276
.map((item) -> !item.isEmpty() ? "\nCATEGORIES:" + resolveCategories() : null).orElse(""),

0 commit comments

Comments
 (0)