I need to include tempusdominus datetimepicker to my Laravel 5.8 project but I am no able to load the scipts and styles correctly.
According documentation I tried to add this lines to my bootstrap.js.
try {
window.$ = window.jQuery = require('jquery');
mix.copy('node_modules/tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.min.css', 'public/css/tempusdominus.css');
require('bootstrap');
require('moment');
require('tempusdominus-bootstrap-4');
require('./main.js');
} catch (e) {}
Watcher sayis everything was compiled successfully but console throws me an error $(...).datetimepicker is not a function and I dont see any tempusdominus css in the public directory.
The script with $().datetimepicker is included via section at the very end of the file this way.
@section('scripts')
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
locale: 'sk'
});
$('#datetimepicker2').datetimepicker({
locale: 'sk'
});
});
</script>
@endsection
What am I doing wrong?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire