[userscripts] Add preview of the days since last events
This commit is contained in:
parent
5c10f840f9
commit
9cf4c40adc
|
@ -43,8 +43,10 @@
|
|||
url: origin + "/api/v4/projects/" + issue.project_id + "/issues/" + issue.iid + "/resource_state_events",
|
||||
onload: function(response) {
|
||||
const resource_state_events = JSON.parse(response.responseText); // const updated_days_ago = Math.round((Date.parse(issue.updated_at) - new Date()) / 86400000);
|
||||
if(resource_state_events.length > 0) {
|
||||
const last_event = resource_state_events[resource_state_events.lastIndex];
|
||||
const event_timeline = resource_state_events.map(state => "" + state.state).join(" → ");
|
||||
|
||||
const time_since_last_event = Math.round((Date.parse(last_event.created_at) - new Date()) / 86400000);
|
||||
const days = time_since_last_event != 0 ? rtf.format(time_since_last_event, "day") : "today";
|
||||
|
||||
|
@ -54,6 +56,7 @@
|
|||
item.append($("<span>", {style: "display: block; min-width: fit-content; font-weight: lighter; font-size:0.6em"}).append(text));
|
||||
$(div).append(item);
|
||||
$(board_info_items).append(div);
|
||||
};
|
||||
|
||||
}});
|
||||
}});
|
||||
|
|
Loading…
Reference in New Issue