question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Date Picker: year selector should appear before the month selector

See original GitHub issue

Consider: http://amsul.ca/pickadate.js/date/#selectors

When selectYears is truthy, the year selector should appear before the month selector.

Check: https://github.com/amsul/pickadate.js/issues/384

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
boustanihanicommented, Aug 27, 2015

Suppose you want to allow ages >= 18 and ask the user to input their birthday:

$('.datepicker').pickadate({
    format: 'dd.mm.yyyy',
    selectYears: 99,
    selectMonths: true,
    max: moment().year(moment().year() - 18).toDate(),
});

It is confusing because if a user tries to select his month first he may not be able to because some month maybe disabled… By positioning the year selector to the left this logically means that the year should be selected first…

Also check: https://github.com/amsul/pickadate.js/issues/384#issue-30706996 We keep running into issues with users where the ui is confusing. When we have “max:true” and some of the months are greyed out it is confusing to the user having to change the year first to select the month…

1reaction
animeshsinghwebcommented, Sep 15, 2017

I did a little tweak in my CSS which worked for me.

.picker__select--month.browser-default {
    float: right;
    margin-right: 2em;
}

Here is a live demo: http://jsbin.com/darewal/edit?css,output

Note

If the page is having more than one pickadate.js it would make the whole thing to appear like this, so if you want only a specific pickadate to look like this, then you need can define another class for selectMonth and selectYear using klass while initialising pickadate, and use that class in css to change. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery UI DatePicker to show month year only - Stack Overflow
I'm using the "MM yy" format in my monthpicker, and the 'yy-mm-dd' format in my datepicker, but this is completely compatible with all...
Read more >
Set day and month on only-year-selector-boostrap-datepicker
Hi. I have a datepicker for selecting only years (since I want to retain fix the day and month). This is the form...
Read more >
<input type="month"> - HTML: HyperText Markup Language
<input> elements of type month create input fields that let the user enter a month and year allowing a month and year to...
Read more >
Customize the Date picker to select Month and Year only
Solved: Customize the date picker to display on Month/Year only. Once the user selects the Month and year, value should be stored something...
Read more >
Date & Time Picker - V-Calendar
To limit user selection to only date components (month, day, year), use mode: 'date' . This is the default prop value, so it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found