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

Provide a way to create DatePicker for Years with NxM grid for year values #2331

Closed
PoltP opened this issue Aug 14, 2020 · 1 comment
Closed

Comments

@PoltP
Copy link
Contributor

PoltP commented Aug 14, 2020

I'm creating a date picker for Years and our design contains 4x4 grid for year values, for sample:

2015  2016  2017  2018

2019  2020  2021  2022

2023  2024  2025  2026

2027  2028  2029  2030

Now, looks like there is no way to implement it using react-datepicker.

As you know, inside the '../src/date_utils.js':

export function getYearsPeriod(date) {
  const endPeriod = Math.ceil(getYear(date) / 12) * 12;
  const startPeriod = endPeriod - 11;
  return { startPeriod, endPeriod };
}

we see '12' as a number of years. Also, this number is used inside another related code (yearsDisabledBefore, yearsDisabledAfter etc.).

Could you implement a property to set number or grid dimensions NxM of year values to show (similar to showTwoColumnMonthYearPicker)?

I reviewed a code and it looks not so hard as hard for us to fix it on our side.

@martijnrusschen
Copy link
Member

#2345

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