Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lrljoe committed Jul 13, 2024
1 parent 9a1ef2e commit cdb005a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions docs/filter-types/filters-daterange.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,26 @@ Then you should disable injection to avoid conflicts:
'inject_third_party_assets_enabled' => false,
```

#### BETA
Noting that should you require localisation, you should also include the localisation scripts in your build
### Option 3 - CDN
You must ensure that Flatpickr is present PRIOR to the tables loading. For example, to add Flatpickr with the Spanish locale, ensure that the following is present in your Layout head section. Noting the "async" presence to ensure that the script is present before a page renders.

It is typically recommended not to utilise the CDN approach, as changes to core code may impact behaviour, and you may need to implement changes to your CSP if present.

If using the CDN approach, ensure the following config matches:
```
'vendor/rappasoft/laravel-livewire-tables/resources/js/flatpickr-locales.js';
'inject_third_party_assets_enabled' => false,
```

or in your app.js
```
import '../../vendor/rappasoft/livewire-tables/resources/js/flatpickr-locales.js';
Then include the following in your layout:
```
// Flatpickr Core Script
<script src="https://npmcdn.com/flatpickr" async></script>
// Flatpickr Core CSS
<link rel="stylesheet" href="https://npmcdn.com/flatpickr/dist/flatpickr.min.css">
```

### Option 3 - Locally Installed
### Option 4 - Locally Installed
If you have a locally installed version of Flatpickr already, you can set injection to false, and your local version will be used instead.
```
'inject_third_party_assets_enabled' => false,
Expand Down Expand Up @@ -115,7 +121,7 @@ import { German } from "../imports/flatpickr/l10n/de.js";
### CDN
You can also add locales using the Flatpickr CDN, ensuring that these are loaded before the page renders.

For example to add German (de), ensure that the following is in the "head" section of your layout:
For example to add German (de), ensure that the following is in the "head" section of your layout, ideally before your app.js
```
<script src="https://npmcdn.com/flatpickr/dist/l10n/de.js" async></script>
```

0 comments on commit cdb005a

Please sign in to comment.