Closed florian-h05 closed 1 year ago
@jpg0 Can you review?
@jpg0 Can you review?
Could you add into the function descriptions what the units of then returned numbers are? I would hope/expect they match the units of the parameters.
I would hope/expect they match the units of the parameters.
Not sure what you mean with this.
what the units of then returned numbers are?
The units would be could of, but I think that the current code wouldn’t even work. I’ll test this later.
I am wondering if we shouldn’t introduce a library for UoM handling like https://github.com/gentooboontoo/js-quantities? WDYT?
Personally I don't believe that we should introduce a units library, at least not yet.
I just wanted to ensure that the return units are easily handled in JS - for example they are milliseconds. I'm not sure what they are from the code/docs.
I just wanted to ensure that the return units are easily handled in JS - for example they are milliseconds. I'm not sure what they are from the code/docs.
It seems that:
But I'm not sure.
@jpg0 Are you fine with my little addition to the docs regarding the units?
@jpg0 I've just noticed that either number or NaN is returned, so either I correct the JSDoc or I modify the function to return number or null as all other functions do.
What would you prefer?
If the other functions return null, then let's keep with that.
Changes the return types of
ItemHistory.
maximumBetween
maximumSince
minimumBetween
minimumSince
from string to number.
Possibly breaking.