Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

fix(datepicker): min date, max date today on initial month/year display[issue#1050] #1056

Closed
wants to merge 6 commits into from

Conversation

ariesjia
Copy link

This pull request about the initial month/year display of the datepicker for issue#1050 .
We add logic when no model value is assigned and the currentDate is less than minDate or more than maxDate date.
if currentDate is less than minDate , the initial selection will be minDate .
if currentDate is more than maxDate , the initial selection will be maxDate.
if currentDate is in the min and max range , the initial selection will be today.
Also if model value is assigned , the initial selection will be the model value

@ariesjia
Copy link
Author

please ignore "Merge remote-tracking branch 'bootstrap/master", it is just merge from yours repo. and remove idea, it is just IDE stuffs.

@ariesjia
Copy link
Author

a42e364 is for button group customise , Our needs is want a button which can setDate ,such as "Next finacial yea r ". Some times we never click today , because today is already beyond the min and max range.

@ariesjia
Copy link
Author

86bfc5b is for customer button click event , Then we can add a method on scope , it's easy to meet all kinds of buttons.

@mvhecke
Copy link
Contributor

mvhecke commented Oct 15, 2013

I ran tests in the following browsers all on Ubuntu 13.04:

  • Chrome 30.0 - Ok
  • Firefox 24 - Ok

@pkozlowski-opensource
Copy link
Member

@Gamemaniak thnx for all the help, it is awesome! But don't loose too much time on running tests - we will run each PR through the AngularJS CI server that has installed all the browsers that AngularJS supports. What would be great is a bit of code review, though! Once again, thnx for getting involved!

@mvhecke
Copy link
Contributor

mvhecke commented Oct 15, 2013

@pkozlowski-opensource I doesn't take up much time, because I only have to modify the karma.conf. I will comment on code if I spot things.

@ghost ghost assigned bekos Jan 19, 2014
@bekos
Copy link
Contributor

bekos commented Jan 25, 2014

@ariesjia Thx for the PR and sorry for the late response. The datepicker has been refactored in #1599 and it has tried to address your issue (#1050) adding the init-date.

Other than that, the logic about the min/max is reasonable, but IMO it is not the general rule and can be solved easily using the init-date. I will have in mind though, in case this issue is raised again :-)

Lastly, about the custom buttons, the idea is good but you make assumptions for the HTML in your code. If you can rework this, so this functionality can be easily added using an extension directive in your template, would be the desired approach.

@bekos bekos closed this Jan 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants