source

  1. html

    1. link
    2. html templdate

      data-date-format="yyyy-mm-dd" data-link-format="yyyy-mm-dd"

    3. startView
      0 or 'hour' for the hour view 1 or 'day' for the day view 2 or 'month' for month view (the default) 3 or 'year' for the 12-month overview 4 or 'decade' for the 10-year overview. Useful for date-of-birth datetimepickers.

    4. minView 日期时间选择器所能够提供的最精确的时间选择视图。

    5. maxView 日期时间选择器最高能展示的选择范围视图。
    6. todayBtn:0/1 (0 don't show today button)

demo

<div class="input-group date" data-info="birthday" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input1" data-link-format="yyyy-mm-dd">
<input class="form-control" size="16" type="text" value="" readonly placeholder="Birthday">
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
</div>
<input required="required" type="hidden" id="dtp_input1" value="" name="birthday" />

$("[data-info='birthday']").datetimepicker({
        weekStart: 1,
        todayBtn: 0,
        autoclose: 1,
        todayHighlight: 1,
        forceParse: 0,
        showMeridian: 1,
        startView: 2,           //kaishi 'day' shitu
        minView: 2,             //zuiduo xuanze 'day'
        startDate: '2015-1-1', //reqi fanwei
        endDate: '2017-1-1',    //reqi fanwei
        daysOfWeekDisabled: [0, 1, 2, 6], //jinzhi xuan de reqi 
    });

$('.form_datetime').datetimepicker({
        //language:  'fr',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        showMeridian: 1
    });
    $('.form_date').datetimepicker({
        language: 'fr',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0
    });
    $('.form_time').datetimepicker({
        language: 'fr',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 1,
        minView: 0,
        maxView: 1,
        forceParse: 0
    });

results matching ""

    No results matching ""