framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

Easier Select Old Years in Calendar

Open amaster507 opened this issue 9 years ago • 3 comments

This is a (multiple allowed):

  • [ ] bug
  • [x] enhancement
  • [ ] feature-discussion (RFC)
  • Framework7 Version: 1.4.2
  • Platform and Target: All

What you did

Want to select date for birthdate using calendar for an old date 50+. Have to click the previous year button 50+ times

Expected Behavior

Have a way to select the year and then replace the calendar with a selection of years and previous next for other years. Something similar to the first example of the datepicker at http://www.eyecon.ro/datepicker/

Actual Behavior

There is no problem with the current operation just time consuming when entering older dates.

amaster507 avatar Jun 18 '16 23:06 amaster507

Hi @amaster507, my dirty solution was create two more buttons like "<<" and ">>". Then when a user click on "<<", i call:

$$('.left10').on('click', function() {
          for (i = 0; i < 10; i++) {
            myCalendar.prevYear();
          }
        }); 

And when click on ">>" I run:

$$('.right10').on('click', function() {
          for (i = 0; i < 10; i++) {
            myCalendar.nextYear();
          }
        });

.right10 and .left10 are classes attached to respective buttons.

This is for 10 years, but you can adjust to yours needs.

calendar

7h3m4dS0u1 avatar Nov 25 '16 17:11 7h3m4dS0u1

@7h3m4dS0u1 could you open a PR perhaps?

ZanderBrown avatar Mar 12 '17 23:03 ZanderBrown

I also like the idea from http://www.eyecon.ro/datepicker/ (and other similar implementations)

cyberbeat avatar Jun 22 '23 20:06 cyberbeat