File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 6666public final class CindyBootstrap {
6767 private static final int MAXIMUM_MASTODON_MESSAGE_LENGTH = 500 ;
6868 private static final DateTimeFormatter GERMAN_TIMESTAMP_FORMATTER = DateTimeFormatter .ofPattern ("d. LLLL yyyy HH:mm" , GERMANY );
69+ private static final DateTimeFormatter GERMAN_DATE_FORMATTER = DateTimeFormatter .ofPattern ("d. LLLL yyyy" , GERMANY );
6970 private static final Logger LOGGER = Logger .getLogger (CindyBootstrap .class .getName ());
7071 private static final ZoneId EUROPE_BERLIN = ZoneId .of ("Europe/Berlin" );
7172
@@ -218,8 +219,15 @@ public void run() {
218219 message .setLength (0 );
219220 if (event .summary () != null )
220221 message .append ("π’ " ).append (event .summary ());
221- if (event .begin () != null )
222- message .append ("\n π
" ).append (GERMAN_TIMESTAMP_FORMATTER .format (event .begin ()));
222+ switch (event .begin ()) {
223+ case null :
224+ break ;
225+ case LocalDate ld :
226+ message .append ("\n π
" ).append (GERMAN_DATE_FORMATTER .format (ld ));
227+ break ;
228+ default :
229+ message .append ("\n π
" ).append (GERMAN_TIMESTAMP_FORMATTER .format (event .begin ()));
230+ }
223231 if (event .location () != null )
224232 message .append ("\n π οΈ " ).append (event .location ());
225233 final var splr = message .toString ();
You canβt perform that action at this time.
0 commit comments