arfedulov / semantic-ui-calendar-react

Datepicker react component based on semantic-ui-react components
https://arfedulov.github.io/semantic-ui-calendar-react/
MIT License
260 stars 92 forks source link

Getting values from dateRange #151

Open usfslk opened 5 years ago

usfslk commented 5 years ago

Hi, is there a way to have those two values as separate strings rather than combined together in an object?

arfedulov commented 5 years ago

Do you mean a way to get start and end values separately rather then in a single value?

Example: if value='2019-05-01 - 2019-05-15'. Then start whould be '2019-05-01' and end would be '2019-05-15'.

Currently the only way to get the value is value prop. But I'm going to add start and end props for convenience.

usfslk commented 5 years ago

For quick fix we split the string

var dateInput = datesRange.split(" - ")

then access values as

dateInput[0] dateInput[1]

I don't know why someone would use a date range picker without a need for values. It should be accessible via props. Thanks!