henninghall / react-native-date-picker

React Native Date Picker is datetime picker for Android and iOS. It includes date, time and datetime picker modes. The datepicker is customizable and is supporting different languages. It's written with native code to achieve the best possible look, feel and performance.
MIT License
2.23k stars 342 forks source link

Feature Request: Enhanced Column Visibility Customization #710

Closed KevinvdBurg closed 1 year ago

KevinvdBurg commented 1 year ago

Summary: Introduce the ability to hide specific columns in various modes (date, time, datetime) of the react-native-date-picker component for better flexibility and user experience.

Background: The react-native-date-picker offers an extensive selection experience for date, time, and datetime. However, there are instances where developers might need a more streamlined selection process by showing only specific columns, thereby eliminating potential distractions.

Details: For the Date Mode, the proposed enhancements are:

  1. Hide the Day Column: Allow selection of just the month and year.
  2. Hide the Day and Month Columns: Focus only on the year.
  3. Hide the Year Column: Allow selection of just the day and month.

For the Time Mode, the enhancements can be: Hide the Minute Column: Allow selection of just the hour. Hide the Hour Column: Allow selection of just the minutes.

For the Datetime Mode, a combination of the above can be implemented, allowing developers to hide any of the date or time columns as per their requirements.

Suggested API Changes:

// Date Mode
<DatePicker
   mode="date"
   hideColumns={['day']}  // hides day column
/>

// Time Mode
<DatePicker
   mode="time"
   hideColumns={['minute']}  // hides minute column
/>

// Datetime Mode
<DatePicker
   mode="datetime"
   hideColumns={['day', 'hour']}  // hides day and hour columns
/>

Benefits:

Potential Challenges:

henninghall commented 1 year ago

Hi, I understand why this could be useful. Unfortunately it is out of scope of this package because of limitations in UIDatePicker, the iOS component this lib is based on.