formio / angular

JSON powered forms for Angular
https://formio.github.io/angular-demo
MIT License
635 stars 469 forks source link

How can i use flatpickr from my app's node_modules rather than requesting it from formio cdn? #965

Open hamodi opened 1 year ago

hamodi commented 1 year ago

After upgrading to version 5.5.0-rc.10, whenever i use datetime field the flatpickr library is being dowloaded from https://cdn.form.io/flatpickr-formio/4.6.13-formio.1/l10n/flatpickr-en-US.js but it keeps returning 404. I need it to load from my app rather than the cdn.

Can anyone help me please?

Thank you!

henriquesoareslima commented 1 year ago

Hi @hamodi,

I use flatpicker installed in my app and set the this in global Window. So Form.io does not download the library.

`import flatpickr from 'flatpickr';

declare global { interface Window { Flatpickr:any; } } window.Flatpickr = flatpickr; `

I hope this helps. Thanks

cah-mohammad-oujeil commented 1 year ago

hi @henriquesoareslima,

Thank you for the reply! the problem is that after i do that, formio is still requestion from the cdn. It is written directly in the calendarWdiget.js

Screenshot 2023-07-13 at 5 34 17 PM