Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java2
2 files changed, 16 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
index 74f81899f..8620fa4bd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
@@ -15,6 +15,7 @@ import java.util.Calendar;
import java.util.Date;
import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.mylyn.commons.core.DateUtil;
import org.eclipse.mylyn.commons.workbench.forms.DatePicker;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
@@ -41,11 +42,14 @@ public class DateAttributeEditor extends AbstractAttributeEditor {
private boolean showTime;
+ private boolean showDateRelative;
+
private Text text;
public DateAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
super(manager, taskAttribute);
setLayoutHint(new LayoutHint(RowSpan.SINGLE, ColumnSpan.SINGLE));
+ setShowDateRelative(false);
}
@Override
@@ -122,6 +126,8 @@ public class DateAttributeEditor extends AbstractAttributeEditor {
if (date != null) {
if (getShowTime()) {
return EditorUtil.formatDateTime(date);
+ } else if (getShowDateRelative()) {
+ return DateUtil.getRelative(date.getTime());
} else {
return EditorUtil.formatDate(date);
}
@@ -158,4 +164,12 @@ public class DateAttributeEditor extends AbstractAttributeEditor {
return true;
}
+ public boolean getShowDateRelative() {
+ return showDateRelative;
+ }
+
+ public void setShowDateRelative(boolean showDateRelative) {
+ this.showDateRelative = showDateRelative;
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java
index dfbce639b..d08b49455 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java
@@ -18,10 +18,12 @@ public class LastCommentedAttributeEditor extends DateAttributeEditor {
public LastCommentedAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
super(manager, taskAttribute);
+ setShowDateRelative(true);
}
@Override
public String getLabel() {
return Messages.LastCommentedAttributeEditor_dateLastCommented;
}
+
}

Back to the top