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

Feature request on onActiveStartDateChange #474

Closed
gyto23 opened this issue Jan 9, 2021 · 2 comments
Closed

Feature request on onActiveStartDateChange #474

gyto23 opened this issue Jan 9, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@gyto23
Copy link

gyto23 commented Jan 9, 2021

I have seen good implementation on the #344 which is awesome to work with, but the onActiveStartDateChange does not give any clue which option has trigger active date to be changed on the calendar.

I would suggest to give additional option in function to give flexibility to set activeStartDate or prevent start date to be changed by clicking on the prev month dates. This is really annoying to me when user click on prev month dates where I dont want it to jump to the prev month but to stay in it, as specially in date range where dates has to be selected in from 30 - 2 (too many clicks)

onActiveStartDateChange={({ activeStartDate, value, view, handlerType }) => {
  // handlerType can be
   // prevLabel - button on the navigation pane
   // nextLabel - button on the navigation pane
   // prev2Label - button on the navigation pane
   // next2Label - button on the navigation pane
   // prevMonth - prev month dates of Dec 27 - 30
   // nextMonth - next month dates of Feb 1 - 6

  if (handlerType === nextMonth) {
   return;
  }
  
  return setActiveStartDate(activeStartDate)
}}

Unless you think to that have this build in to just boolean prop so that it easy on of when it needs

image

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label Aug 26, 2021
@wojtekmaj wojtekmaj added enhancement New feature or request and removed stale labels Aug 26, 2021
@wojtekmaj
Copy link
Owner

Good idea. Added property action that can have the following values: "prev", "prev2", "next", "next2", "drillUp", "drillDown", "onChange".

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

No branches or pull requests

2 participants