31 lines
1.3 KiB
PHP
31 lines
1.3 KiB
PHP
@if(!defined('LOAD_DATEPICKER'))
|
|
@push('css')
|
|
<link rel="stylesheet" href="{!! asset('/assets/plugins/datepicker/css/tempusdominus-bootstrap-4.min.css') !!}">
|
|
@endpush
|
|
@push('js')
|
|
@include('load.moment')
|
|
<script src="{!! asset('/assets/plugins/datepicker/js/tempusdominus-bootstrap-4.min.js') !!}"></script>
|
|
<script>
|
|
$.fn.datetimepicker.Constructor.Default = $.extend({}, $.fn.datetimepicker.Constructor.Default, {
|
|
locale: '{{ (App::getLocale() == 'en' ? 'en-GB' : App::getLocale()) }}',
|
|
icons: $.extend({}, $.fn.datetimepicker.Constructor.Default.icons, {
|
|
time: 'far fa-clock',
|
|
date: 'far fa-calendar-alt',
|
|
up: 'fa fa-chevron-up',
|
|
down: 'fa fa-chevron-down',
|
|
})
|
|
});
|
|
|
|
function initDatepicker(sel, format, date) {
|
|
var selector = (typeof(sel) == 'undefined') ? '.datepicker' : sel;
|
|
var format = (typeof(format) == 'undefined') ? 'L' : format;
|
|
// var date = (typeof(date) == 'undefined') ? new Date() : date;
|
|
$(selector).datetimepicker({
|
|
format: format
|
|
});
|
|
}
|
|
</script>
|
|
@endpush
|
|
@php(define('LOAD_DATEPICKER', true))
|
|
@endif
|