angular.js - angular的datepicker怎么限制只能选择当月日期?

查看:221
本文介绍了angular.js - angular的datepicker怎么限制只能选择当月日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

1、现在有一个需求,当startdate被选后,enddate只能选择同一个月的日期,比如 startdate选择了 2016-04-21 那么enddate只能选择4月份的内容,请问怎么设置

2、怎么删掉日历上的选择按钮

解决方案

  1. 设置minDate/maxDate

max-date="endDate" on the startDate input
min-date="startDate" on the endDate input


  1. 修改对应的template

https://github.com/angular-ui/bootstrap/blob/master/template/datepicker/day.html

templateCache key => "uib/template/datepicker/day.html"

这篇关于angular.js - angular的datepicker怎么限制只能选择当月日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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