Let me show you the code for my picker in a simple way:
import {moment} from 'moment';
const datePicker = () => {
$('.datetimepicker').datetimepicker({
format: 'LT',
locale: 'PT-BR',
icons: {
up: "fa fa-chevron-up",
down: "fa fa-chevron-down",
},
stepping: 15,
disabledTimeIntervals: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]]
});
};
export {datePicker};
The part that is causing trouble,
disabledTimeIntervals: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]]
, is directly from the official documentation.
However, including it leads to an error:
dtPicker.js:24 Uncaught TypeError: Object(...) is not a function