简体   繁体   English

jQuery UI Datepicker-隐藏特定月份的上一个导航箭头

[英]jQuery UI Datepicker - Hide previous navigation arrow for a specific month

I have a simple angular code that opens the jQuery datepicker with a future date (within an angular directive): 我有一个简单的角度代码,用于使用将来的日期(在角度指令内)打开jQuery datepicker:

            scope.StartDate = $filter('date')(scope.BillingDate,'MM/dd/yyyy');
            $('#rangeFromSelect').datepicker({maxDate: new Date("10/10/2020")}); // this fires up the datepicker correctly

If scope.BillingDate = 06/12/2018 it shows up the datepicker correctly, but I wish to hide any days before that particular date. 如果scope.BillingDate = 06/12/2018,它将正确显示日期选择器,但我希望隐藏该特定日期之前的任何日期。 My approach to hide the previous navigation works when I do the following: 当执行以下操作时,我隐藏先前导航的方法起作用:

$('.ui-datepicker-prev').hide();

This works OK until I press the next month and get back to the previous month (ie, the previous navigation button shows up again). 直到我按下下个月并返回上个月(即,再次显示上一个导航按钮)为止,此方法都正常。

Is there anyway to hide the arrow for that specific month? 无论如何,有没有隐藏该特定月份的箭头? Or is there a way I could completely disable the dates before the date I mentioned here? 还是有一种方法可以完全禁用我在这里提到的日期之前的日期?

Not sure if I understand the problem correctly but could you use the Min Date Option? 不知道我是否能正确理解问题,但是您可以使用“最小日期选项”吗?

$( ".selector" ).datepicker({
  minDate: new Date(2007, 1 - 1, 1)
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM