cutenode / cutenode/libgfi

feature request: Tell how many days an issue has since being opened

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
25
Forks
5
PR merge metrics
No merged PRs in 30d

Description

## Description

It would be nice to see how many days an issue has been open, to more easily check how new the issue is.

## Possible implementation

As I see it, it could be implemented by adding this parameter in the `transform` function inside `lib/search.js`. Something like this:
```
function transform (data) {
const issues = data.items
.filter(item => item.assignee === null && item.locked !== true)
.reduce((acc, item) => {
return acc.concat({
title: item.title,
pr: item.number,
labels: item.labels,
state: item.state,
repo: item.repository_url,
url: item.html_url,
assignee: item.assignee,
assignees: item.assignees,
locked: item.locked,
daysOpened: diffDate(item.created_at)
})
}, [])

return issues
}
```

it would then be a question of creating the function `diffDate` to get the number of days between the time the issue was created and the current time.

Contributor guide

Open the contributing guide

Research direction

Start in lib/search.js at the transform function and trace how the returned issue objects are consumed. Check the GitHub created_at value and the existing output shape, then verify that results expose a daysOpened value representing the issue's age.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.