-
Notifications
You must be signed in to change notification settings - Fork 11
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
Mixed-type duration math: addition of calyears or calmonths with days, hours, etc. #136
Comments
It's a bug. Tablicious's date/time support is only like 60% complete, with respect to Matlab's full functionality. :) I'll prioritize adding this in, now that I know someone actually wants to use it. Can probably have it done and out in a new Tablicious 0.4.4 release by, say, Thursday? DiagnosisI think the issue here is that addition is defined for the duration and calendarDuration classes, but not mixed-type addition between them.
And calendarDuration has a times method, but I missed the mtimes variant.
Both of these fixes should be pretty straightforward. Might be complicated a bit by the need to support mixed signs between the different fields, and handle how calendar years and months get normalized between each other. |
For completeness, in calendarDuration class there is not defined the mtimes method in order to multiply calyears and calmonths times a scalar. This operation is defined in Matlab |
That's in now, in 3f5fbc7 on branch caldur-math-fixes.
|
Here's a fix for mixed-type duration + calendarDuration arithmetic, I think: b8e3745
|
Thank you very much for your (date)time :) |
LOL. :) |
I can see that duration objects and calendarDuration objects can't be added or substracted
In Matlab this kind of operation works and the result can be used as increment with the colon operator in order to create sequences. Is this a bug in tablicious or a feature?
The text was updated successfully, but these errors were encountered: