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

Allow calculation of days between x and y (timedelta) #2953

Closed
LaurensBurger opened this issue Mar 31, 2023 · 2 comments · Fixed by maykinmedia/json-logic-py#16 or #3521
Closed

Allow calculation of days between x and y (timedelta) #2953

LaurensBurger opened this issue Mar 31, 2023 · 2 comments · Fixed by maykinmedia/json-logic-py#16 or #3521
Assignees
Milestone

Comments

@LaurensBurger
Copy link
Collaborator

LaurensBurger commented Mar 31, 2023

Thema / Theme

Form designer

Omschrijving / Description

Sentry: 327615
utr: 66

As a form designer i want to calculate the amount of days between 2 dates.
While i can use the provided validation on a date(time) component there is currently no way to use it in other ways to for example:
Show the amount of days a person is requesting a permit for X
The days until event y

Currently trying to deducting the following dates:

"date1": "2023-03-16T00:00:00+01:00", 
"date2": "2023-03-24T00:00:00+01:00", 

does result in:

datetime.timedelta(days=8)

But the form crashes: "Object of type timedelta is not JSON serializable."

@LaurensBurger LaurensBurger added triage Issue needs to be validated. Remove this label if the issue considered valid. enhancement labels Mar 31, 2023
@joeribekker joeribekker added this to the Release 2.4.0 milestone Aug 10, 2023
@joeribekker joeribekker removed the triage Issue needs to be validated. Remove this label if the issue considered valid. label Aug 10, 2023
@joeribekker
Copy link
Contributor

Refinement: In gesprek met Menno/Maarten: de uitkomst kan in dagen en deze kan als variabele beschikbaar worden gemaakt zodat hier berekeningen of logica mee gedaan kunnen worden.

Bijvoorbeeld: datum X - datum Y = Z dagen; Als Z < 14 dan ...

@joeribekker
Copy link
Contributor

Refinement: date X - date Y = Z should result (and be serialized) in a ISO period string. Then you should also be able to do: Z < P14D

@joeribekker joeribekker assigned SilviaAmAm and unassigned bart-maykin Oct 2, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 3, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 3, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 3, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 3, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 3, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 3, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 3, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 3, 2023
@SilviaAmAm SilviaAmAm reopened this Oct 4, 2023
SilviaAmAm added a commit that referenced this issue Oct 4, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 6, 2023
SilviaAmAm added a commit to maykinmedia/json-logic-py that referenced this issue Oct 6, 2023
SilviaAmAm added a commit that referenced this issue Oct 10, 2023
SilviaAmAm added a commit that referenced this issue Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
5 participants