CalebMorris / react-moment-proptypes

React proptype validator for moment.js
49 stars 17 forks source link

DurationString support #29

Closed alex-shamshurin closed 6 years ago

CalebMorris commented 7 years ago

Currently validates that duration is in Object form index.js#L119, but Moment allows a string format that moment converts. I'm assuming that this is what you are referring to and requesting.

Sounds good to me and I'll add it once I get a chance and can finish some of the testing changes I've been working on

CalebMorris commented 6 years ago

For context the Duration documentation can be found at http://momentjs.com/docs/#/durations/.

Considering the variety of support levels of what is considered a valid Duration string (and even detecting if a Duration object is valid), I'm not sure it is simple to maintain support direct string input.

@alex-shamshurin Can you describe a specific use-case that it would be more beneficial to wrap strings rather than directly passing a Duration object?