-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Datepicker - year-range seems to be completely ignored #3338
Comments
@antoinepairet Sorry to keep piling these on you, but thought it was worth checking if fixed on HEAD |
It has everything to do with this fancy line of code (which is very hard to read): self[key] = angular.isDefined($attrs[key]) ? (index < 8 ? $interpolate($attrs[key])($scope.$parent) : $scope.$parent.$eval($attrs[key])) : datepickerConfig[key];
|
I've rewritten that oneliner to a more debuggable block: if(angular.isDefined($attrs[key])) {
if (index < 8) {
var val = $interpolate($attrs[key])($scope.$parent);
self[key] = val;
} else {
var val = $scope.$parent.$eval($attrs[key]);
self[key] = val;
}
} else {
self[key] = datepickerConfig[key];
} Now I'm wondering -- why loop through injected |
Well for now I've worked around this issue by setting Not working<input
type="text"
class="form-control input-sm"
placeholder="{{ 'LABEL.PLEASE_CHOOSE' | translate }}"
id="dob"
name="dob"
ng-model-options="formModelOptions"
ng-model="dob"
max-date="datepickerEighteen"
datepicker-mode="'year'"
datepicker-popup="dd-MM-yyyy"
year-range="9"
datepicker-options="dobOptions"
is-open="dobOpened"
required
readonly="readonly" /> Workaround<input
type="text"
class="form-control input-sm"
id="dob"
name="dob"
oh-validate-model-state
ng-model-options="formModelOptions"
ng-model="dob"
max-date="datepickerEighteen"
datepicker-mode="'year'"
datepicker-popup="dd-MM-yyyy"
year-range="9"
datepicker-options="dobOptions"
is-open="dobOpened"
required
readonly="readonly" /> $scope.dobOptions = {
yearRange: 9
}; |
@karianna That looks promising.. there won't be a fix any time soon? 😉 |
@antoinepairet Is our resident datepicker maintainer (at present) - we'll be looking at all of the related PRs over the coming weeks (it's going to take some time) :-) |
@karianna @antoinepairet If you're able to shortly explain to what your process is to check these related PRs I might be able to help out. I wouldn't mind being a contributor for the datepicker module. I'm using it a lot in projects are able to debug issues / implement fixes. For now I'll stick to PRs but you guys already have a lot of these pending. |
@rvanbaalen If you'd like to become a maintainer then you'd be more than welcome. Please join the gitter where we discuss merges etc. We'll have a meeting to triage PRs next week as well IIRC |
I would definitely be interested in becoming a contributor @karianna. I did find the gitter indeed. Just need to catch up with everything going on there. |
Can't see why this is a angular 1.3 support issue - moving to 0.13.x |
The 0.13 milestone was added before we had a meeting about the contents of 0.13 😉 |
Would like to help, but I'm confused about what's wanted here. |
When I use the
year-range
attribute on mydatepicker-popup
directive, it seems to be completly ignored.I set it to value
9
like this:and also tried this:
But both don't work and this is always the result:
I would expect the datepicker to show the years in a 3x3 grid (9 total).
I'm using UI Bootstrap
0.12.1
and Angular JS1.3.13
The text was updated successfully, but these errors were encountered: