【问题标题】:Bootstrap DateTimePicker renders incorrectlyBootstrap DateTimePicker 渲染不正确
【发布时间】:2018-05-05 19:57:09
【问题描述】:

我对日期时间选择器有疑问。我的日历在 Chrome 中呈现不正确,但在 Edge 中可以。这是Chrome的屏幕截图:

这是来自 Edge 的截图:

我正在开发 ASP.NET Core MVC 项目,这是我的代码:

<div class="wrap-input100 validate-input" data-validate="Required field">
                        <input type="text" class="form-control" id="AppointmentDate" name="date" placeholder="date">
                        <span @*class="focus-input100"*@></span>
                    </div>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>

<script>
$(document).ready(function() {
    var date_input = $('input[name="date"]'); //our date input has the name "date"
    var options = {
        format: 'mm/dd/yyyy',
        todayHighlight: true,
        autoclose: true,
        language: 'arm'
    };
    date_input.datepicker(options);
});

</script>

【问题讨论】:

    标签: c# html css twitter-bootstrap asp.net-core-mvc


    【解决方案1】:

    我没有你的 css 样式,但我建议你将它添加到日历的主 div 中:

    #yourmaindiv{
     width: -webkit-fit-content;
     width: -o-fit-content;
     width: -moz-fit-content;
     width: fit-content;
    }
    

    您好。

    【讨论】:

    • 让我知道它是否正常工作,否则你能把这个页面的样式表发给我吗。
    • 没问题。祝你有美好的一天
    猜你喜欢
    • 2018-05-10
    • 2013-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-22
    • 2011-03-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多