0

In order to handle dates I needed to install an npm package called tempusDominus, which needs to be extended in order to support custom date formats. However when I follow the documentation (Accounting for laravel's quirks) I should have it written like this in my bootstrap.js file

tempusdominus = require('@eonasdan/tempus-dominus');
tempusdominus.extend(tempusdominus.plugins.customDateFormat);

window.tempusdominus = tempusdominus;

However, it throws an error that says that customDateFormat is undefined.

The original documentation states the following as a way to extend the original class.

tempusDominus.extend(tempusDominus.plugins.customDateFormat);
//or
import customDateFormat from 'tempusDominus/plugins/customDateFormat'
tempusDominus.extend(customDateFormat);

What am I doing wrong? And how can i solve it? Some help would be greatly appreciated

0 Answers0