Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialDate is overriden by minDate on DatesRangeInput #180

Open
priverblack opened this issue Nov 8, 2019 · 3 comments
Open

initialDate is overriden by minDate on DatesRangeInput #180

priverblack opened this issue Nov 8, 2019 · 3 comments

Comments

@priverblack
Copy link

priverblack commented Nov 8, 2019

After defina a min and max date the initialDate value is overriden and the date picker opens on the mindate value. If I don't set a minDate and maxDate the date picker opens correctly.

My Code

 <DatesRangeInput
               name="datesRange"
               placeholder={t('accounts.movements.date-filter')}
               icon="calendar alternate outline"
               iconPosition="right"
               style={{ color: "#0997A7" }}
               onChange={handleChangeDate}
               closable={true}
               dateFormat={dateFormat}
               maxDate={new Date(new Date().getFullYear(), 11, 30)}
               minDate={new Date(new Date().getFullYear() - 1, 0, 2)}
               value={datesRange}
 />         

Expected behavior
The date picker should open on the default of initialDate(today's date)

Dependencies versions
"semantic-ui-calendar-react": "^0.15.3",
"semantic-ui-react": "^0.88.0",

@DovahBrownies
Copy link
Contributor

@paulopretoEI - Have you tried just adding initialDate={new Date()} (where new Date() is the correct date format)?

@itajenglish
Copy link

Is there a fix for this issue @arfedulov ?

@kcolwell
Copy link

@paulopretoEI - Have you tried just adding initialDate={new Date()} (where new Date() is the correct date format)?

I have tried this and the calendar still defaults to the minDate value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants