From cd2f8a9c9fea202a4edb2a475e1455ef879cd6a2 Mon Sep 17 00:00:00 2001 From: gotty Date: Wed, 20 Nov 2019 12:59:25 +0000 Subject: [PATCH] [LIB-10] Date and Timezone format constants from snooker.properties git-svn-id: https://svn.hedgecode.org/lib/snooker-score-api/trunk@189 fb0bcced-7025-49ed-a12f-f98bce993226 --- src/main/java/org/hedgecode/snooker/SnookerDateUtils.java | 10 ++++++---- src/main/resources/snooker.properties | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/hedgecode/snooker/SnookerDateUtils.java b/src/main/java/org/hedgecode/snooker/SnookerDateUtils.java index 69da93b..126ab5a 100644 --- a/src/main/java/org/hedgecode/snooker/SnookerDateUtils.java +++ b/src/main/java/org/hedgecode/snooker/SnookerDateUtils.java @@ -30,11 +30,13 @@ public final class SnookerDateUtils { private static SnookerDateUtils _instance; - public static final String DATE_PATTERN = "dd.MM.yyyy"; - public static final String TIME_PATTERN = "HH:mm"; - public static final String DATETIME_PATTERN = String.format("%s %s", TIME_PATTERN , DATE_PATTERN); + private static final String DATE_PATTERN = SnookerScoreProperties.get("snooker.date.format"); + private static final String TIME_PATTERN = SnookerScoreProperties.get("snooker.time.format"); + private static final String DATETIME_PATTERN = String.format("%s %s", TIME_PATTERN , DATE_PATTERN); - private static final TimeZone SNOOKER_TIMEZONE = TimeZone.getTimeZone("CET"); + private static final TimeZone SNOOKER_TIMEZONE = TimeZone.getTimeZone( + SnookerScoreProperties.get("snooker.timezone") + ); private static final TimeZone LOCAL_TIMEZONE = TimeZone.getDefault(); private final DateFormat dateFormat; diff --git a/src/main/resources/snooker.properties b/src/main/resources/snooker.properties index 7aa4d84..cda4e80 100644 --- a/src/main/resources/snooker.properties +++ b/src/main/resources/snooker.properties @@ -16,3 +16,6 @@ snooker.name=snooker-score-api snooker.version=1.0-SNAPSHOT snooker.inception.year=2017 snooker.port.number=1470 +snooker.date.format=dd.MM.yyyy +snooker.time.format=HH:mm +snooker.timezone=CET -- 2.10.0