最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - bootstrap datepicker in RTL layout is not working properly - Stack Overflow

programmeradmin1浏览0评论

bootstrap datepicker in RTL layout is not working properly, I'm using this bootstrap datepicker This is the code my code in page.cshtml

<div class="form-group" id="data_3">
  <label class="col-md-3 control-label">@Resources.ResourceLanguages.BirthDate</label>
  <div class="input-group date col-md-8" data-provide="datepicker">
    <div class="col-md-1"></div>
    <span class="input-group-addon"><i class="fa fa-calendar"></i></span> @Html.TextBoxFor(m => m.BirthDate, "{0: dd/MM/yyyy}", new { @class = "form-control", type = "text", placeholder = @Resources.ResourceLanguages.BirthDate, ReadOnly = "" }) @Html.ValidationMessageFor(m
    => m.BirthDate)
  </div>
</div>

and this is my javascript code

$(document).ready(function() {
  $('#data_3 .input-group.date').datepicker({
    startView: 2,
    todayBtn: "linked",
    keyboardNavigation: false,
    forceParse: false,
    autoclose: true,
    orientation: "top left"
  });
});

This is the problem I get, I tried every solution in the internet, but nothing works, is there any solution for this problem? does bootstrap datepicker support the RTL layout?

bootstrap datepicker in RTL layout is not working properly, I'm using this bootstrap datepicker http://bootstrap-datepicker.readthedocs.io This is the code my code in page.cshtml

<div class="form-group" id="data_3">
  <label class="col-md-3 control-label">@Resources.ResourceLanguages.BirthDate</label>
  <div class="input-group date col-md-8" data-provide="datepicker">
    <div class="col-md-1"></div>
    <span class="input-group-addon"><i class="fa fa-calendar"></i></span> @Html.TextBoxFor(m => m.BirthDate, "{0: dd/MM/yyyy}", new { @class = "form-control", type = "text", placeholder = @Resources.ResourceLanguages.BirthDate, ReadOnly = "" }) @Html.ValidationMessageFor(m
    => m.BirthDate)
  </div>
</div>

and this is my javascript code

$(document).ready(function() {
  $('#data_3 .input-group.date').datepicker({
    startView: 2,
    todayBtn: "linked",
    keyboardNavigation: false,
    forceParse: false,
    autoclose: true,
    orientation: "top left"
  });
});

This is the problem I get, I tried every solution in the internet, but nothing works, is there any solution for this problem? does bootstrap datepicker support the RTL layout?

Share Improve this question edited Jun 26, 2018 at 12:21 Mosh Feu 29.3k18 gold badges93 silver badges141 bronze badges asked Feb 13, 2017 at 2:31 amal50amal50 1,0112 gold badges22 silver badges35 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

add this style to the end of your style to overload the current style

.datepicker {
   direction: rtl;
}
.datepicker.dropdown-menu {
   right: initial;
}

or you can add this to the head of your layout

 <style>         
      .datepicker {
        direction: rtl;
      }             
    .datepicker.dropdown-menu {
right: initial;             
      }     
    </style>
发布评论

评论列表(0)

  1. 暂无评论