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

Multi Date Functionality Display Issues in Latest version. #12

Closed
nishStoryDigital opened this issue Jan 7, 2021 · 3 comments
Closed

Comments

@nishStoryDigital
Copy link

Hi Shahab, I've upgraded to the latest version ( 2.0.2 ) from 1.8.0. Here are my observations while using this package for our project.

  1. It would be better if multiple dates selected can be displayed in ascending order in the date field.
  2. If I use, a custom component, like MUI-Textfield as the input field, and select multiple dates, selected dates doesn't show in the field, but their value is being correctly taken.

Feel free to experiment in this Sandbox.

custom-tf
date-order

@shahabyazdi
Copy link
Owner

shahabyazdi commented Jan 7, 2021

Firstly, the reason I told you to upgrade the package was because two persons in same date told me that they had problem with their packages and I thought it is better to tell you so the possible problem could be prevented. But after doing several tests in previous versions I noticed that there is no problem in previous packages and you can downgrade the package to v1.8.0 safely.

Regarding the sorting dates : based on reasons which I mentioned in #11 I'm not gonna sort dates anymore. you should sort them manually in onChane method

onChange={dates=>setValue(dates.sort((a,b)=>a-b))}

and in regard to setting string date in custom inputs at multiple and range mode , I changed the stringDate to array of strings in order to make it more feasible to work with, for example maybe you want to display just first and second dates or you want to use different seperetor instead "," which is in default input , only you can do this things if you have got array of strings and it's not possible to do such works with stringDate , you can see the example here

@shahabyazdi
Copy link
Owner

shahabyazdi commented Jan 7, 2021

also I modified your codesandbox to work as you expected.

https://codesandbox.io/s/young-framework-lk852?file=/src/MultiDatePicker.js

@shahabyazdi
Copy link
Owner

fb908dc

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

2 participants