Quellcode durchsuchen

Support for core topic date changes.

pull/440/head
Chris Smith vor 8 Jahren
Ursprung
Commit
e4fe58ed1a

+ 2
- 2
logging/src/com/dmdirc/addons/logging/LoggingManager.java Datei anzeigen

@@ -280,8 +280,8 @@ public class LoggingManager implements ConfigChangeListener {
280 280
 
281 281
         appendLine(filename, "*** Topic is: %s", event.getTopic().getTopic());
282 282
         appendLine(filename, "*** Set at: %s on %s by %s",
283
-                timeFormat.format(1000 * event.getTopic().getTime()),
284
-                dateFormat.format(1000 * event.getTopic().getTime()),
283
+                timeFormat.format(event.getTopic().getDate()),
284
+                dateFormat.format(event.getTopic().getDate()),
285 285
                         event.getTopic().getClient()
286 286
                                 .map(GroupChatUser::getNickname).orElse("Unknown"));
287 287
     }

+ 1
- 2
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicDisplayPane.java Datei anzeigen

@@ -41,7 +41,6 @@ import com.dmdirc.ui.messages.ColourManagerFactory;
41 41
 import java.awt.Color;
42 42
 import java.awt.datatransfer.Clipboard;
43 43
 import java.awt.event.KeyEvent;
44
-import java.util.Date;
45 44
 import java.util.Optional;
46 45
 
47 46
 import javax.swing.JLabel;
@@ -164,7 +163,7 @@ public class TopicDisplayPane extends JPanel implements DocumentListener {
164 163
         if (topic.isPresent()) {
165 164
             topicWho.setText("Topic set by " + topic.get().getClient()
166 165
                     .map(GroupChatUser::getNickname).orElse("Unknown")
167
-                    + "<br> on " + new Date(1000 * topic.get().getTime()));
166
+                    + "<br> on " + topic.get().getDate());
168 167
             topicText.setText(topic.get().getTopic());
169 168
         } else {
170 169
             topicWho.setText("No topic set.");

+ 1
- 4
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicLabel.java Datei anzeigen

@@ -29,7 +29,6 @@ import com.dmdirc.interfaces.GroupChat;
29 29
 import com.dmdirc.interfaces.GroupChatUser;
30 30
 
31 31
 import java.awt.Color;
32
-import java.util.Date;
33 32
 
34 33
 import javax.swing.JEditorPane;
35 34
 import javax.swing.JPanel;
@@ -49,8 +48,6 @@ public class TopicLabel extends JPanel {
49 48
 
50 49
     /** A version number for this class. */
51 50
     private static final long serialVersionUID = 1;
52
-    /** How many milliseconds in a second. */
53
-    private static final int MILLIS_IN_SECOND = 1000;
54 51
     /** Topic this label represents. */
55 52
     private final Topic topic;
56 53
     /** The group chat to which this label belongs. */
@@ -138,7 +135,7 @@ public class TopicLabel extends JPanel {
138 135
         }
139 136
         add(label, "wmax 450, grow, push, wrap, gapleft 5, pad 0");
140 137
 
141
-        label = new TextLabel("on " + new Date(topic.getTime() * MILLIS_IN_SECOND));
138
+        label = new TextLabel("on " + topic.getDate());
142 139
         add(label, "wmax 450, grow, push, wrap, gapleft 5, pad 0");
143 140
 
144 141
         add(new JSeparator(), "newline, span, growx, pushx");

Laden…
Abbrechen
Speichern