禁用Angularjs日期选取器具体日期 [英] Disable specific dates in Angularjs date picker

查看:319
本文介绍了禁用Angularjs日期选取器具体日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在日期选取器 AngularJS 禁用具体日期。

I want to disable specific dates in the date picker of AngularJS.

我使用 AngularJS,引导 CSS的组件。

I am using AngularJS-bootstrap css for components.

我要禁用将根据previous价值的组合选择动态变化的日期。

The dates which I want to disable will be changing dynamically based on the selection of previous value in combo.

我相信日期禁用=禁用(日期模式)应该工作,虽然不能肯定。

I believe date-disabled="disabled(date, mode)" should work, though not sure.

我怎样才能做到这一点?

推荐答案

我假设你正在使用的角度-UI的日期选择器指令。在日期停用属性,可以禁用特定日期(周末为例)。看到这个普拉克 http://plnkr.co/edit/gGAU0L?p=$p$pview

I'm assuming you are using the Datepicker directive from Angular-UI. The date-disabled attribute lets you disable certain dates (weekends for example). See this plunk http://plnkr.co/edit/gGAU0L?p=preview

如果您要根据选择动态禁用日期,您可以使用最大属性和观察家。见<一href=\"http://plnkr.co/edit/W5pb1boMLOHZFnWkMU8o?p=$p$pview\">http://plnkr.co/edit/W5pb1boMLOHZFnWkMU8o?p=$p$pview

If you want to dynamically disable dates based on selection, you can use the min and max attributes and watchers. See http://plnkr.co/edit/W5pb1boMLOHZFnWkMU8o?p=preview


<一个href=\"http://angular-ui.github.io/bootstrap/#/datepicker\">http://angular-ui.github.io/bootstrap/#/datepicker

这篇关于禁用Angularjs日期选取器具体日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆