Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Angular material date only loads a few years at a time

Brett King pro asked 7 years ago


Hello,

I'm having an issue with the default functionality for the angular material date picker. With the below object I'm able to navigate to the year 1917 with the year drop down in the date picker, however I have to click into the drop down multiple times to get there instead of just clicking the drop down once and then scrolling to the correct year.

I believe this is working as intended, however for the average user I can see this being very frustrating especially since they can't just type a year into this box. Is there anyway around this functionality? I'm using angular MDBoostrap version 4.3.1

{{ "dateFormat": "mm/dd/yyyy", "disableSince": {year: 2017, month: 10, day: 16}, "disableUntil": {year: 1917, month: 10, day: 14}, "maxYear": 2017, "minYear": 1917 }

Witold Tkaczyk free commented 7 years ago

Hello, I answered you under the related post with an answer that could help you. Do you still have this issue?

Brett King pro commented 7 years ago

Yes because the code you supplied, and the code I assume you have for the next update is still only loading 7 years at a time in the drop down right? I could alter the function to solve my issue but I was wondering if a configuration could be made instead so that you could configure how many years to show in the drop down, or perhaps have a configuration for 'showAllApplicableYears'. Like I said in my question above, I recognize this isn't a 'bug', but more of an issue with usability I find if you have a lot of years to choose from.

Witold Tkaczyk free answered 7 years ago


Hello,

I can't reproduce your error. This is how my example looks: http://prntscr.com/h19i42. I need more information. For start tell me what browser do you use?


Brett King pro commented 7 years ago

Actually I just updated the code that you supplied from my other issue and it looks like that resolves this as well. Sorry about that, I looked at the code and saw it was doing something with 7 years and assumed. I will set this to resolved, and anyone looking in the future with an earlier version can look at this (https://mdbootstrap.com/support/angular-material-date-doesnt-load-past-years-correctly/) or update to mdbootstrap's latest.

Witold Tkaczyk free commented 7 years ago

I'm glad I could help :)


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No
Tags