I'm using the datepicker for AngularUI.
By default it lists the days from the previous month and the next month. Here's a picture.
How do I make these days invisible. I'd like the first day to always be Sunday. So the days should be listed Sunday, Monday, Tuesday, etc on top of the columns.
You can try this;
This will remove the borders for the parentNode which is a Button. So It won't show the previous month & next month dates. Note that we are hiding the dates with the css only.
I have added a new class (btn-secon) to the button, if it is dt.secondary using the existing ng-class directive. Then wrote css targetting this class to hide that button by setting display:none. The code of the button now will look as follows:
I modified day.html creation code block in the angularUI file (in my case file name is ui-bootstrap-tpls-0.12.1.js) hide the date button when dt.seconday is true. ng-hide=\"dt.secondary\"
updated code block looks like
You could do this with css:
http://plnkr.co/EOS6geIcM5KO6tBwlxZF
But, you probably need to make it more specific to avoid interfering with other bootstrap elements that may use
text-muted
.Update To go further and disable the now invisible days, you can customize the
disable
function that is referenced byng-disable
on each day. For example:This is overly simplistic, but works for the initial date and should get you started.
I solved this by using the custom class option which can take an expression that returns a string. It is passed the selected date and the mode. But within that you can use
this
to access pretty much anything that the datepicker uses internally.then in your controller\component
And now in your site's css you can do something like this: