“JQuery DaterangePicker” Kode Jawaban

Tanggal Tanggal Pilih Pilih Tanggal dan beberapa minggu

<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />

<div class="row">
    <input id="daterangepicker" type="text" />
    <select>
          <option value="1">Mo</option>
          <option value="2">Tu</option>
          <option value="3">We</option>
          <option value="4">Th</option>
          <option value="5">Fr</option>
          <option value="6">Sa</option>
          <option value="0">Su</option>
      </select>
</div>

<script>
$(document).ready(function () {
  $('#daterangepicker').daterangepicker({
    parentEl: '.row',
    isInvalidDate: function(date) {
      return parseInt($(this.container).parent().find('select').val()) !== new Date(date).getDay();
    }
  });
});
</script>
Ivan The Terrible

JQuery DaterangePicker

<input type="text" name="daterange" value="01/01/2018 - 01/15/2018" />

<script>
$(function() {
  $('input[name="daterange"]').daterangepicker({
    opens: 'left'
  }, function(start, end, label) {
    console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
  });
});
</script>
Yanislav Ivanov

Jawaban yang mirip dengan “JQuery DaterangePicker”

Pertanyaan yang mirip dengan “JQuery DaterangePicker”

Lebih banyak jawaban terkait untuk “JQuery DaterangePicker” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya