Skip to content

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

@sanlf

Description

@sanlf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions