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

Add function to measure the duration since a date or timestamp #916

Open
ricardoleal opened this issue Nov 25, 2024 · 2 comments
Open

Add function to measure the duration since a date or timestamp #916

ricardoleal opened this issue Nov 25, 2024 · 2 comments
Labels
area/api Related to the REST API feature New feature or request

Comments

@ricardoleal
Copy link

Describe the feature request

It would be nice to be able to check if a data is older than 48h

Example:

  conditions:
    - "[BODY].run.date <= 48h"

This is done already in certificates, but i did not find any documentation to use with dates.

Why do you personally want this feature to be implemented?

We have some use cases where it would be nice to monitor.

How long have you been using this project?

6m

Additional information

No response

@TwiN
Copy link
Owner

TwiN commented Nov 28, 2024

Hmm, I guess the strategy here would be to add a function like timeago that would internally convert the value into a value that represents how long ago this occurred, something like:

  conditions:
    - "timeago([BODY].run.date) <= 48h"

This is a good idea.

Maybe age instead of timeago? 🤔

@TwiN TwiN changed the title Compare result with todays date Add function to measure the duration since a date or timestamp Nov 28, 2024
@TwiN TwiN added feature New feature or request area/api Related to the REST API labels Nov 28, 2024
@ricardoleal
Copy link
Author

I'm not a developer, but the goal would be a way to test if that date in the last hour value. example last 24h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the REST API feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants