Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a human readable duration helper function #20198

Closed
rarkins opened this issue Feb 3, 2023 · 6 comments · Fixed by #20231
Closed

Create a human readable duration helper function #20198

rarkins opened this issue Feb 3, 2023 · 6 comments · Fixed by #20231
Assignees
Labels
priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Feb 3, 2023

What would you like Renovate to be able to do?

Support durations in human-readable form such as 1w 2d, so we can start converting fields like stabilityDays to be more generic.

If you have any ideas on how this should be implemented, please tell us here.

Seems like we need the reverse of https://github.com/sindresorhus/pretty-ms

Is this a feature you are interested in implementing yourself?

No

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:ready labels Feb 3, 2023
@zharinov zharinov self-assigned this Feb 4, 2023
@zharinov
Copy link
Collaborator

zharinov commented Feb 4, 2023

How about this one? https://github.com/vercel/ms

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 4, 2023

Looks good but does it allow composite, like 1w 1d?

If not and they don't want it, maybe we wrap it, split by space, and then return the sum.

@zharinov
Copy link
Collaborator

zharinov commented Feb 4, 2023

Seems like they've implemented it at some point, so most probably we can just focus on our feature which requires it.

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 4, 2023

Let's make sure it's part of their official "api" so it doesn't change on us one day without us noticing

@zharinov
Copy link
Collaborator

zharinov commented Feb 4, 2023

Ohh, you were right, it's not supported. Well, not that hard to implement.

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 34.125.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants