mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
LH: date formatting
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.intellij.history.integration;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -23,7 +25,10 @@ public class FormatUtil {
|
||||
public static final DateFormat FORMAT = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
|
||||
public static String formatTimestamp(long t) {
|
||||
DateFormat f = FORMAT;
|
||||
return f.format(new Date(t));
|
||||
return FORMAT.format(new Date(t));
|
||||
}
|
||||
|
||||
public static String formatRelativeTimestamp(long t) {
|
||||
return StringUtil.formatDate(t, FORMAT);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public abstract class FileDifferenceModel {
|
||||
}
|
||||
|
||||
private String formatTitle(Entry e, boolean isAvailable) {
|
||||
String result = FormatUtil.formatTimestamp(e.getTimestamp()) + " - " + e.getName();
|
||||
String result = FormatUtil.formatRelativeTimestamp(e.getTimestamp()) + " - " + e.getName();
|
||||
if (!isAvailable) {
|
||||
result += " - " + LocalHistoryBundle.message("content.not.available");
|
||||
}
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ public class RecentChangesPopup {
|
||||
public Component getListCellRendererComponent(JList l, Object val, int i, boolean isSelected, boolean cellHasFocus) {
|
||||
RecentChange c = (RecentChange)val;
|
||||
myActionLabel.setText(c.getChangeName());
|
||||
myDateLabel.setText(FormatUtil.formatTimestamp(c.getTimestamp()));
|
||||
myDateLabel.setText(FormatUtil.formatRelativeTimestamp(c.getTimestamp()));
|
||||
|
||||
updateColors(isSelected);
|
||||
return myPanel;
|
||||
|
||||
@@ -309,7 +309,7 @@ public class RevisionsList {
|
||||
|
||||
myBorder.set(row == table.getModel().getRowCount() - 1);
|
||||
|
||||
myDateLabel.setText(ensureString(StringUtil.formatDate(r.revision.getTimestamp(), FormatUtil.FORMAT)));
|
||||
myDateLabel.setText(ensureString(FormatUtil.formatRelativeTimestamp(r.revision.getTimestamp())));
|
||||
myFilesCountLabel.setText(ensureString(labelsAndColor.filesCount));
|
||||
|
||||
myTitleLabel.setFont(myTitleLabel.getFont().deriveFont(labelsAndColor.isNamed ? Font.BOLD : Font.PLAIN));
|
||||
|
||||
Reference in New Issue
Block a user