New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dateinput] Year Selector should be based on today, not current value of control #89

Closed
rroesler opened this Issue Jun 22, 2010 · 3 comments

Comments

Projects
None yet
2 participants
@rroesler

rroesler commented Jun 22, 2010

Suggest this code

                // year selector
                var base = new Date();
                yearSelector.empty();                   
                for (var i = base.getFullYear() + conf.yearRange[0];  i <= base.getFullYear() + conf.yearRange[1]; i++) {
                    if (min < new Date(i + 1, -1, 0) && max > new Date(i, 0, 0)) {
                        yearSelector.append($("<option/>").text(i));
                    }
                }
@tipiirai

This comment has been minimized.

Show comment
Hide comment
@tipiirai

tipiirai Jul 22, 2010

Contributor

hmm. cannot really decide on which one is better. can you explain to me why present year is better than the selected year to motivate me.

Contributor

tipiirai commented Jul 22, 2010

hmm. cannot really decide on which one is better. can you explain to me why present year is better than the selected year to motivate me.

@rroesler

This comment has been minimized.

Show comment
Hide comment
@rroesler

rroesler Aug 5, 2010

Yes .. imaging that you have a yearRange such as [-100,0] for choosing birth dates. I select my birth date (19xx) and that become the new reference ? Now the next time the popup is displayed, the range is 19xx-100 to 19xx-0 instead on the original 2010-100 to 2010-0. If you had accidentally chosen a to-early year, there is no way to correct your entry because the yearRange is preventing later years from being chosen.

yearRange based on now makes some sense. So would a yearRange with real dates. And using min/max instead of yearRange wold also work,

rroesler commented Aug 5, 2010

Yes .. imaging that you have a yearRange such as [-100,0] for choosing birth dates. I select my birth date (19xx) and that become the new reference ? Now the next time the popup is displayed, the range is 19xx-100 to 19xx-0 instead on the original 2010-100 to 2010-0. If you had accidentally chosen a to-early year, there is no way to correct your entry because the yearRange is preventing later years from being chosen.

yearRange based on now makes some sense. So would a yearRange with real dates. And using min/max instead of yearRange wold also work,

@tipiirai

This comment has been minimized.

Show comment
Hide comment
@tipiirai
Contributor

tipiirai commented Aug 15, 2010

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment