diff --git a/.classpath b/.classpath index 940e2b6..a2dc425 100644 --- a/.classpath +++ b/.classpath @@ -26,7 +26,6 @@ - diff --git a/lib/joda-time-2.8.1-source.zip b/lib/joda-time-2.8.1-source.zip deleted file mode 100644 index 899ebb0..0000000 Binary files a/lib/joda-time-2.8.1-source.zip and /dev/null differ diff --git a/lib/joda-time-2.8.1.jar b/lib/joda-time-2.8.1.jar deleted file mode 100644 index 94be659..0000000 Binary files a/lib/joda-time-2.8.1.jar and /dev/null differ diff --git a/src/org/april/hebdobot/model/Hebdobot.java b/src/org/april/hebdobot/model/Hebdobot.java index 3d96c63..4895fe2 100644 --- a/src/org/april/hebdobot/model/Hebdobot.java +++ b/src/org/april/hebdobot/model/Hebdobot.java @@ -22,6 +22,8 @@ package org.april.hebdobot.model; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.Collection; import org.apache.commons.collections.CollectionUtils; @@ -45,8 +47,6 @@ import org.april.hebdobot.util.BuildInformation; import org.jibble.pircbot.IrcException; import org.jibble.pircbot.NickAlreadyInUseException; import org.jibble.pircbot.PircBot; -import org.joda.time.DateTime; -import org.joda.time.format.ISODateTimeFormat; import org.quartz.SchedulerException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -310,7 +310,7 @@ public class Hebdobot extends PircBot else { { - String date = ISODateTimeFormat.basicDate().print(new DateTime()); + String date = LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE); String textReview = this.review.toString(); if (this.pastebinSettings.isValid()) @@ -342,6 +342,7 @@ public class Hebdobot extends PircBot } File file = new File(this.reviewDirectory, date + "_" + this.reviewFileSuffix); FileUtils.writeStringToFile(file, textReview, StandardCharsets.UTF_8); + logger.info("File review saved in: [{}]", file.getAbsolutePath()); sendMessage("% Compte-rendu de la revue : " + file.getName()); } catch (final Exception exception) diff --git a/src/org/april/hebdobot/model/review/Message.java b/src/org/april/hebdobot/model/review/Message.java index 6c92fda..19c19cf 100644 --- a/src/org/april/hebdobot/model/review/Message.java +++ b/src/org/april/hebdobot/model/review/Message.java @@ -19,14 +19,14 @@ */ package org.april.hebdobot.model.review; -import org.joda.time.DateTime; +import java.time.LocalDateTime; /** * The Class Message. */ public class Message { - private final DateTime date; + private final LocalDateTime date; private final String author; private final String content; @@ -42,7 +42,7 @@ public class Message { this.author = author; this.content = content; - this.date = new DateTime(); + this.date = LocalDateTime.now(); } /** @@ -70,7 +70,7 @@ public class Message * * @return the date */ - public DateTime getDate() + public LocalDateTime getDate() { return this.date; } diff --git a/src/org/april/hebdobot/model/review/Review.java b/src/org/april/hebdobot/model/review/Review.java index f1d58b0..a97ec24 100644 --- a/src/org/april/hebdobot/model/review/Review.java +++ b/src/org/april/hebdobot/model/review/Review.java @@ -19,15 +19,16 @@ */ package org.april.hebdobot.model.review; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import org.apache.commons.lang3.StringUtils; import org.april.hebdobot.model.UserAliases; -import org.joda.time.DateTime; -import org.joda.time.format.DateTimeFormat; import fr.devinsy.util.strings.StringSet; @@ -211,7 +212,8 @@ public class Review addLine(buffer, '='); addCenter(buffer, "Revue de la semaine en cours"); addEmpty(buffer); - addCenter(buffer, DateTimeFormat.fullDate().print(new DateTime())); + addCenter(buffer, + StringUtils.capitalize(LocalDateTime.now().format(DateTimeFormatter.ofPattern("EEEE dd MMMM yyyy").withLocale(Locale.FRENCH)))); addLine(buffer, '='); addEmpty(buffer); addEmpty(buffer);