twitter-bootstrap jQuery bootstrap 日期范围选择器,仅使用月份查看模式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23384115/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 20:37:14  来源:igfitidea点击:

jQuery bootstrap date range picker with months only view mode

jquerytwitter-bootstrapdatepickertwitter-bootstrap-3daterangepicker

提问by RonyK

I need a jQuery date range picker that combines the features of these following two great plug-ins. In bootstrap-daterangepickerI'm missing the ability to define only months view mode. And in bootstrap-datepickerI'm missing few things:

我需要一个 jQuery 日期范围选择器,它结合了以下两个很棒的插件的功能。在bootstrap-daterangepicker 中,我缺少仅定义月视图模式的能力。在bootstrap-datepicker 中,我缺少一些东西:

  • The ability to use only one input field to represent the range and show the selected range inside it (using the defined format and separator)
  • A validation that the "from" is earlier than the "to" (preferably disabling all earlier dates in the "to" calendar - like the first plug-in does).
  • Configuring predefined date ranges ranges (last year, last month, etc. ) - That's a nice to have :)
  • 能够仅使用一个输入字段来表示范围并在其中显示所选范围(使用定义的格式和分隔符)
  • 验证“from”早于“to”(最好禁用“to”日历中的所有较早日期 - 就像第一个插件所做的那样)。
  • 配置预定义的日期范围(去年、上个月等) - 这很好:)

Can anyone recommend such a plug-in that has all these mentioned features? Or recommend the best way to add the missing features to one of them?

任何人都可以推荐一个具有所有这些提到的功能的插件吗?或者推荐将缺失功能添加到其中之一的最佳方法?

采纳答案by RonyK

I decided to extend 'bootstrap-daterangepicker' to support month view mode. I've posted a pull request, but you can find my version here.

我决定扩展“bootstrap-daterangepicker”以支持月视图模式。我已经发布了一个拉取请求,但你可以在这里找到我的版本。

https://github.com/rklachko/bootstrap-daterangepicker/tree/month-view

https://github.com/rklachko/bootstrap-daterangepicker/tree/month-view