Closed agriboz closed 9 years ago
It looks like your selectedDays
times in milliseconds aren't corresponding to midnight on the days you want selected- though that may be a timezone issue.
It does initially show December for me, so I'm guessing you're having trouble getting the dates to show as selected.
Check out my fork and let me know if it helps:
@agriboz , what you want is set init-date
.
And as @spongessuck said, your dates are not correct.
Please use new Date().setHours(0,0,0,0)
instead (as described on Usage)
Here is a working fork for your plunker: http://plnkr.co/edit/ZzJvLF?p=preview
It is working quite well at the moment. Thanks for your quick reply.
By the way, have you ever tried with the new version of angular-bootstrap 0.14.2
. It seems activated dates are not working correctly.
@agriboz , again, to show the correct month, use init-date
instead of activeDate
.
This code won't work properly:
var test = new Date(1450735200000).setHours(0,0,0,0);
//test.setDate(test.getDate()-1);
//this.activeDate = 1450735200000;
// TypeError: newVal.getTime is not a function
this.activeDate = test;
// it shows the correct month, however, it breaks selectedDays array (removes)
This should be
var test = new Date(1450735200000).setHours(0,0,0,0);
//test.setDate(test.getDate()-1);
//this.activeDate = 1450735200000;
// TypeError: newVal.getTime is not a function
this.initDate = test;
// it shows the correct month, however, it breaks selectedDays array (removes)
And add a init-date="app.initDate"
in your <datepicker>
.
angular-bootstrap 0.14.2
doesn't change datepicker as seen in changelog.
So if it works with 0.14.1
, it will work with 0.14.2
as well.
@agriboz Please try using the newest release of the module (v1.0.6) which was released yesterday. This version will support UI Bootstrap 0.14.
Here is the scenario, I have
selectedDays
array miliseconds in it. What i want is, showing the datepicker for the correct month.http://plnkr.co/edit/aiy7kv?p=preview