Date/Time datatype #2695
Replies: 6 comments
-
Yes I like that idea. It's not useful for the JavaScript API (as there are exellent JS libraries for working with dates), but for the expression parser it can be a nice addition to be able to work with dates. We should think about what API we would like to offer then, and see if this can really work out nicely. |
Beta Was this translation helpful? Give feedback.
-
Here are some thoughts about this: I think it's important to allow different representations of dates, like
Operators:
As this is not changing anything existing this doesn't have to be in v2 necessarily because it can be introduced in a non-breaking matter. It can be introduced in later point versions, or am I wrong? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your input Max. I don't expect breaking changes here so there is no need to align this with the v2 release. We indeed have to deal with Dates (point in time) and with periods (a duration or interval). The latter is already supported in very limited form: you can create units like What we should prevent is writing our own Just as an idea for the API:
|
Beta Was this translation helpful? Give feedback.
-
If this is still on the list, you may consider to use the TC39 temporal proposal
|
Beta Was this translation helpful? Give feedback.
-
Using |
Beta Was this translation helpful? Give feedback.
-
Yes, still support for dates is still interesting. We'll have to think though an API in detail first I think, see how it can work out in the expression parser, and what to use underneath it (moment.js is outdated already). Good point @m93a about taking into account the ideas in #2212. |
Beta Was this translation helpful? Give feedback.
-
I'm following the evolution of mathjs towards v2 and I have a proposal about a new datatype.
It would be good to have the ability to do common operations like add and substract with time and date values. What do you think about it?
Beta Was this translation helpful? Give feedback.
All reactions