Bootstrap DateTime Picker插件?

时间:2018-11-27 15:05:23

标签: javascript jquery bootstrap-4

这是一个可以正常工作的简单DatePicker。

<head>
   <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/>

<script>
    $(document).ready(function(){
      var date_input=$('input[name="date"]'); //our date input has the name "date"
      var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
      var options={
        format: '"dd/MM/yyyy - hh:ii"',
        container: container,
        todayHighlight: true,
        autoclose: true,
      };
      date_input.datetimepicker(options);
    })
</script>
<head>
<body> 
  <div class="form-group"> <!-- Date input -->
      <label class="control-label" for="date">Date</label>
      <input class="form-control" id="date" name="date" placeholder="MM/DD/YYY" type="text"/>
  </div>
</body>

如何更改上面的代码,以使其使用DATETIME选择器?我假设我需要在标题中使用其他插件?请问有人可以建议吗?

1 个答案:

答案 0 :(得分:0)

    public char Test4(double grade)
    {
        // TODO: Write code here to compute an answer.
        //       Return the answer from this function.
        //       Read the lab document for detailed instructions.
        if (grade >= 90.0)
        { return 'A'; }
        else
            if (grade >= 80.0)
        { return 'B'; }
        else
            if (grade >= 73.0)
        { return 'C'; }
        else 
            if (grade >=70.0)
        { return 'D'; }
        else
            if (grade >= 0)
        { return 'F'; }
        else
            if (grade <0 )
        { return '?'; }
        else
            if (grade > 100)
        { return '?'; }
    }
$(function() {
  $('#datetimepicker1').datetimepicker();
});

来源:https://eonasdan.github.io/bootstrap-datetimepicker/

https://stackoverflow.com/a/40036266/4091337的帮助下进行SO工作 和@Abhishek发表评论