在datepicker中悬停时显示箭头

时间:2017-03-01 16:08:06

标签: javascript jquery html css datepicker

我有一个这样的日期选择器:

enter image description here

当我悬停时,出现了三个箭头来改变日期或显示日历。

我想删除此箭头。

这是代码:

link: function (scope, element, attr, ngModel) {
      if (attr.type !== 'date') return;
          var calendarioIco=angular.element('<div class="input-group-addon"><i class="fa fa-calendar"></i></div>');
          calendarioIco.on('click',function(){
              element.datepicker('show');
          })
          element.before(calendarioIco);
            jQuery(element).datepicker({
                autoclose:true,
                language:'es',
                weekStart:1,
                format:'yyyy-mm-dd',
            }).on('changeDate', function(dateText, inst){
                    jQuery(jQuery(element).data('greater')).datepicker("setStartDate",
                    jQuery(element).datepicker("getDate"));
                 }).on('mouseenter', function (){
                            $(this).removeClass("hover");

                 });
    }

谢谢你,抱歉我的英文,

1 个答案:

答案 0 :(得分:1)

您应该可以使用此代码段删除它们:

input[type="date"]::-webkit-inner-spin-button, 
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  display: none;
}

您可以在此行下看到一个示例

$('#withoutArrows').datepicker({});
$('#withArrows').datepicker({});
input[type="date"].clear-style::-webkit-inner-spin-button, 
input[type="date"].clear-style::-webkit-calendar-picker-indicator,
input[type="date"].clear-style::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  display: none;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js"></script>



<div class="col-md-4"><input id="withoutArrows" type="date" class="form-control clear-style"></div>
<div class="col-md-4"><input id="withArrows" type="date" class="form-control"></div>