Comments (7)
Hey, @ept-Ayush Your link is not working.
from datepicker.
Hey, @ept-Ayush Your link is not working.
@Feshchenko Thanks for response. Sorry for that it was private Try this.
Also one more thing I wanted to confirm I am trying create something similar to AIRBNB DATEPICKER where
-
if you see once you select the start date and endDate and after that you again click the date which is after the startDate the range selection is getting changed. but if click before the startdate that date will become new start date
-
if you click on the enddate first so enddate is getting selected and one can select the start date before the end date but if someone selected greater than enddate so that date become start date again and user have to choose the end date.
Do we have these features?
from datepicker.
- I see the issue describe in the first post and it is an edge case. Possible solution if you allow to select only from the current date and further, you should handle it, reset user range and show message about it.
- We don't support functionality like on airbnb screenshots
from datepicker.
-
We can allow from the selection from current date but as I said he selected that range in Feb itself now he is seeing that range in April so it has to show. and even its happening for the future date itself if you select march and April as a default value it will not show March & April together which I think is a bug.
-
For that is it possible that in https://github.com/rehookify/datepicker/blob/main/packages/datepicker/src/use-days.ts we can give a option weather we want to trigger onDatesChange from inside or not ? By that I think I can create these features.
@Feshchenko Also another thing is if we want to set only endDate and startDate as blank we can not set that we get errors as mentioned in #48
from datepicker.
- I see the issue describe in the first post and it is an edge case. Possible solution if you allow to select only from the current date and further, you should handle it, reset user range and show message about it.
@Feshchenko Regarding this we have one more issue
if today is March 31 2024 we have March and April calendar on the screen with left navigation button as disabled and right month button as enabled. Now if click right button and go to next available months, that is, April and May but now left icon is disabled although today is 31 March (even we disable the past date). Can we expect any solution for this?
MicrosoftTeams-video.4.mp4
from datepicker.
@ept-Ayush please provide link to the codesandbox
What version of the datepicker is installed?
from datepicker.
@Feshchenko I have checked that with 6.6.0 on 31 March. Its happening if the day is last day of the month (31 March 2024) and the next month have less dates (30 Apr 2024). But I can't produce that from outside now as todays date is different can't reproduce that same scenario from outside may be if you try, you will be able to get that issue from inside in that specific sceanrio. The issue is might be in subtractOffset nextDate variable, its seems it was getting some wrong value and hence resulting the minDateAndBefore(minDate, nextDate)
in true and making isDisabled true. where minDate was 31 March 2024 and next Date was 29 Feb.
** Here in my scenario state.offsetDate and minDate was new Date(2024, 2, 31) and negativeOffsetValue was {days: -0, months: -1, years: -0}**
const offsetDate = getEdgedOffsetDate(state.offsetDate, negativeOffsetValue, minDate);
const nextDate = getNextOffsetDate(offsetDate, negativeOffsetValue);
// will get this true which is wrong
const isDisabled = !!disabled || minDateAndBefore(minDate, nextDate);
And I guess it will be in 6.6.1 as well as I have compared the changes.
Here's sample codesandbox but you will not get the issue as the date is changed.
Let me know if you have any doubts.
from datepicker.
Related Issues (20)
- Why not aria-select=true on the selected dates? HOT 4
- WeekPicker HOT 3
- Key values are invalid in example HOT 3
- Accessibility HOT 3
- Default selected time is outside of the enabled range HOT 1
- Keep the time when selecting a different day HOT 1
- useTime Performance HOT 4
- Features Missing according to documentation. Please update documentation and examples. HOT 2
- nextMonthButton and previousMonthButton are missing from prop getters HOT 2
- Start of Years HOT 5
- How to change years independently for only one calendar HOT 2
- Problem with maxDate and month view HOT 2
- Contributing HOT 1
- Add Keyboard navigation. HOT 2
- Selecting time with set_focus_date HOT 4
- Limiting the choice of months by minDate HOT 1
- Give an option to set start date as empty as well HOT 2
- Strange behavior of the time picker (time duplication) when you select March 31 and then March 30
- Documentation error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datepicker.