Bootstrap日期选择器已经过了几个月

时间:2013-11-16 08:59:30

标签: jquery twitter-bootstrap

我正在使用Bootstrap datepicker并加载相关的文本框,日期说,今天(无论你在哪里)。但是当我点击输入时,选择器本身将在未来几个月,我不知道为什么?

enter image description here

<legend>Schedule</legend>
<div class="editor-label">
    <label for="ClosingDate">Closing Date</label>
</div>
<div class="editor-field">
    <div class="input-append date" id="dp3" data-date="16/11/2013" data-date-format="dd-mm-yyyy">
        <input class="span2 datepicker" data-val="true" data-val-date="The field Closing Date must be a date." data-val-required="Closing date for post is required" id="ClosingDate" name="ClosingDate" readonly="readonly" size="18" type="text" value="18/11/2013 9:46:13 p.m." />
        <span class="add-on"><i class="icon-th"></i></span>
    </div>
    <span class="field-validation-valid" data-valmsg-for="ClosingDate" data-valmsg-replace="true"></span>
</div>
</fieldset>

1 个答案:

答案 0 :(得分:2)

初始化datepicker的格式会对你有帮助。

$('.datepicker').datepicker({
    format: 'dd/mm/yyyy'
});

强制性JSFiddle