-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 DateTime Delta Operation #1732
Conversation
Add test for time-delta
Add DateTime Delta to categories
Some change to re-run tests.
Another commit for re-build
I've gone back to this PR half a dozen times and, umming and erring as to whether to approve it or not. The operator works (apart from a few linting issues caught by eslint). The parsing of dates is normal and supports a wide variety of formats. My issue is with the 'delta' argument. It is very brittle and needs to be in that specific format. I wonder if we could replace it with a better format? I can't find any great examples online to use. The 'moment' library accepts partial times (e.g. 12:13:14) but parses them to the current day, which isn't useful. I'm open to suggestions / opposition, but I don't think the current format is suitable. Some options off the top of my head:
|
Hey, thanks for the input. If not, I'm open to implement other changes. Can you give an example of time period? can this be like "5 hours, 32 minutes and 3 seconds?" |
I like your idea of separating out the time units into each individual text box! That feels like a way better solution. ❤️ |
Day, hour, minute, second. Instead of a single string.
Yell when this is ready to re-review :) |
Hey, I think it's ready :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to give back for this great tool. Actually I had similar operation in mind if this goes well (as it did) which is time difference, which is kinda the opposite operation from this one (given two dates, how much time passed between). Any special consideration for this one? |
Adds DateTime Delta operations.
This allows to calculate a new DateTime given an input DateTime and the amount of time passed / before the input DateTime.
For example:
Input: 20/02/2024 13:36:00
Difference: +0.00:01:00
Output: 20/02/2024 13:37:00