cullophid / date-fp

Functional programming date manipulation library
121 stars 17 forks source link

consolidate date validation in one function #18

Closed svozza closed 8 years ago

svozza commented 8 years ago

The min and max functions work differently to the other functions because they ignore invalid dates if at least one valid date has been provided. This makes the underlying find function they're implemented with look a bit odd as it now sanitises the data twice. It should probably work like the other functions in the library and return an error if any of the dates are invalid but that would be a breaking change. I would prefer if there was no error handling logic in any of these functions.