角UI日期选择器限制天至一个月 [英] Angular UI Datepicker Limiting Days to One Month
问题描述
我使用的是日期选择为AngularUI 。
默认情况下,列出了从previous月和下个月的日子。 这里有一个图片。
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.
推荐答案
您可以用CSS做到这一点:
You could do this with css:
.text-muted {
color: transparent;
}
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
.
更新
更进一步,禁用现在看不见的日子里,你可以自定义由引用的
上每天。例如:禁用
功能NG-禁用
Update
To go further and disable the now invisible days, you can customize the disable
function that is referenced by ng-disable
on each day. For example:
$scope.disabled = function(date, mode) {
return date.getMonth() !== $scope.dt.getMonth();
};
这是过于简单化,但工程的初始日期,应该让你开始。
This is overly simplistic, but works for the initial date and should get you started.
这篇关于角UI日期选择器限制天至一个月的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!