Skip to content

Commit 21d91c3

Browse files
committed
shorter date
1 parent 4582722 commit 21d91c3

File tree

1 file changed

+10
-4
lines changed
  • services/static-webserver/client/source/class/osparc/ui/basic

1 file changed

+10
-4
lines changed

services/static-webserver/client/source/class/osparc/ui/basic/DateAndBy.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,15 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
7878
__applyDate: function(value) {
7979
if (value) {
8080
const label = this.getChildControl("date-text");
81-
label.set({
82-
value: osparc.utils.Utils.formatDateAndTime(value),
83-
});
81+
const today = new Date();
82+
const yesterday = new Date();
83+
if (today.toDateString() === value.toDateString()) {
84+
label.setValue(osparc.utils.Utils.formatDateAndTime(value)); // show date and time
85+
} else if (yesterday.toDateString() === value.toDateString()) {
86+
label.setValue(osparc.utils.Utils.formatDateAndTime(value)); // show date and time
87+
} else {
88+
label.setValue(osparc.utils.Utils.formatDate(value)); // show date only
89+
}
8490
}
8591
},
8692

@@ -92,7 +98,7 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
9298
atom.setLabel("by me");
9399
} else {
94100
atom.setLabel("by");
95-
osparc.dashboard.CardBase.addHintFromGids(atom, [groupId]);
101+
osparc.dashboard.CardBase.addHintFromGids(atom, [groupId]);
96102
}
97103
}
98104
},

0 commit comments

Comments
 (0)