Skip to content

feat: ion-datepicker to allow future years with simpler option #30572

Open

Description

@eric-lesslie

Prerequisites

Describe the Feature Request

A new flag on ion-datetime picker to specifically control the maximum selectable year in the absence of yearValues or a max.

Describe the Use Case

The current default only allows for dates with years to be selected in the past. A lot of business logic cases involve both the potential to select both past and future dates to be selected 5, 10, 15 years into the future. Setting this flag allows for the year wheel to allow for future years without specifying a large list of values in yearValues.

Future dates seems to be a really ha

Describe Preferred Solution

A flag maxYearValue to be used as a fallback in the absence of yearValues or max which allows for the year wheel to have future years simply without an exhaustive yearList.

Describe Alternatives

Currently there is a work around in yearList as,

Array.from({length: 100 + maxYearValue}, (_, i) => new Date().getFullYear() - 100 + i);

Related Code

export const getYearColumnData = (
locale: string,
refParts: DatetimeParts,
minParts?: DatetimeParts,
maxParts?: DatetimeParts,
yearValues?: number[]
): WheelColumnOption[] => {
let processedYears = [];
if (yearValues !== undefined) {
processedYears = yearValues;
if (maxParts?.year !== undefined) {
processedYears = processedYears.filter((year) => year <= maxParts.year!);
}
if (minParts?.year !== undefined) {
processedYears = processedYears.filter((year) => year >= minParts.year!);
}
} else {
const { year } = refParts;
const maxYear = maxParts?.year ?? year;
const minYear = minParts?.year ?? year - 100;
for (let i = minYear; i <= maxYear; i++) {
processedYears.push(i);
}
}
return processedYears.map((year) => ({
text: getYear(locale, { year, month: refParts.month, day: refParts.day }),
value: year,
}));
};

This could just need a new flag that's the fallback in between maxParts?.year and year on line 493

Additional Information

No response

Activity

  1. changed the title [-]feat:[/-] [+]feat: ion-datepicker to allow future years with simpler option[/+] on Jul 28, 2025
  2. toozuuu commented on Oct 28, 2025

    @toozuuu

    Hi @eric-lesslie and Ionic team,

    I noticed the feature request for adding a flag to the ion-datetime picker to allow future years without the need for yearValues or a max date. This would indeed simplify scenarios where users need to select dates several years into the future.

    In the meantime, if you're looking for an alternative solution that offers more flexibility, you might find ngxsmk-datepicker
    helpful. It's a standalone, zero-dependency Angular component that supports:

    Image Image Image
    • Single, range, and multiple date selection

    • Inline and popover display modes

    • Light and dark themes

    • Holiday marking with a custom provider

    • 12h/24h time selection with AM/PM toggle

    • Predefined date ranges like “Last 7 Days”

    • Advanced localization (i18n)

    • Fully customizable via CSS variables

    It works well with Angular 17+ and Ionic apps and could serve as a drop-in replacement or complement to ion-datetime for date selection functionality.

    Feel free to check it out and let me know if you have any questions or feedback!

  3. added
    community feedback wanted
    and removed on Apr 3, 2026
  4. ionitron-bot commented on Apr 3, 2026

    @ionitron-bot

    This issue has been labeled as community feedback wanted. This label is added to issues that we would like to hear from the community on before moving forward with any final decision on the feature request.

    If the requested feature is something you would find useful for your applications, please react to the original post with 👍 (+1). If you would like to provide an additional use case for the feature, please post a comment.

    The team will review this feedback and make a final decision. Any decision will be posted on this thread, but please note that we may ultimately decide not to pursue this feature.

    Thank you!

  5. added and removed
    community feedback wanted
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions