【问题标题】:How can I update date using Datepicker?如何使用 Datepicker 更新日期?
【发布时间】:2019-10-03 00:23:13
【问题描述】:

如何使用 Datepicker 更新日期?这就是我在下面创建 Datepicker 的方式。

<script>
    $(function () {
        $('#datepicker').datepicker({
            dateFormat: 'yy-mm-dd',
            changeMonth: true,
            changeYear: true,
            yearRange: '-100y:c+nn',
            maxDate: '1d'
        });
    });
</script>

【问题讨论】:

    标签: jquery datepicker laravel-6


    【解决方案1】:
    • 请尝试以下代码。

    <div class="form-group col-lg-4"> <label>Selected Month Invoice : </label> <div class='input-group date' id='invoice_date'></div> </div>

    <script type="text/javascript"> $(function () { $('#invoice_date').datepicker({ dateFormat: 'd-m-yy' }); }); $('#invoice_date').change(function () { var invoice_date = $('#invoice_date').val(); // console.log(invoice_date);
    // Check date print in console. // Write here ajax code for update date in database. }); </script>

    感谢 PHPanchal

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-13
      相关资源
      最近更新 更多