1

I followed this, and there is no error message but the datetimepicker doesn't appear on the input element.

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="/html/template/default/assets/js/function.js"></script>
<script src="/html/template/admin/assets/js/vendor/moment.min.js"></script>
<script src="/html/template/admin/assets/js/vendor/moment-with-locales.min.js"></script>
<script src="/html/template/admin/assets/js/vendor/tempusdominus-bootstrap-4.min.js"></script>

<script>
    $(function () {

        $('input.datetimepicker-input').datetimepicker({
            locale: 'ja',
            format: 'YYYY-MM-DD HH:mm:ss',
            useCurrent: true,
            buttons: {
                showToday: true,
                showClose: true
            },
        });

    
    });
</script>

<input type="text" id="shopping_order_time" name="_shopping_order[time]" required="required" class="datetimepicker-input" data-target="#shoppingtakeout_time" data-toggle="datetimepicker">

If someone has any idea about what is causing the problem could you please help?

jnpps
  • 39
  • 4

1 Answers1

0

The problem was that the value of the data-target was not the element's id.

jnpps
  • 39
  • 4