Download the PHP package tareq-alqadi/filament-flatpickr without Composer

On this page you can find all versions of the php package tareq-alqadi/filament-flatpickr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-flatpickr

Filament Flatpickr

Flatpickr date, time, range, month and week pickers for Filament 4 and 5 forms.

Installation

Pickers

The classes share their names with Filament's own DatePicker, DateTimePicker and TimePicker, so import the ones you want, or alias one set (use ... DatePicker as FlatpickrDatePicker;).

Saved values

Each picker saves text, which Eloquent's date casts and date columns accept.

Picker Saved as
DatePicker "2024-01-15"
DateTimePicker "2024-01-15 14:30:00", in the app's timezone
TimePicker "14:30", or "14:30:15" with ->seconds()
DateRangePicker ["2024-01-01", "2024-01-05"], in order; cast the attribute to array
MultiDatePicker ["2024-01-01", "2024-03-01"]; cast the attribute to array
MonthPicker the month's first day, "2024-02-01"
WeekPicker the week's first day, "2024-01-14"

->format('d/m/Y') changes what is saved, and how text given to the field is read. $get('field') gives the value as it would be saved. Defaults and $set() take text in that format, anything Carbon reads, or date objects.

A range of one day starts and ends on it. A week starts on the locale's first day, or ->firstDayOfWeek().

Formats

->displayFormat() sets what the field shows. Both formats use PHP's date characters, as Filament's own pickers do. Month and day names follow the locale.

Picker Default display format
DatePicker, DateRangePicker, MultiDatePicker F j, Y (January 15, 2024)
DateTimePicker F j, Y H:i (F j, Y H:i:s with seconds)
TimePicker H:i (H:i:s with seconds)
MonthPicker F Y
WeekPicker \W\e\e\k W, Y (Week 3, 2024), with "Week" translated

A display format with g, h or A gives the time a 12-hour clock: ->displayFormat('M j, Y g:i A'). A display format can use d D j jS l w W F m M n y Y H h g i s A U; any other letter needs a backslash before it.

Typing

->allowInput() lets the user type a value in the display format, as well as pick one. Text that isn't a date, or is a date that doesn't exist such as 31 February, empties the field instead of becoming another date.

Timezones

->timezone('America/New_York') sets the timezone a DateTimePicker shows. Its values are read and saved in config('app.timezone'). Days, months and weeks are the same in every timezone.

A browser can only work with times its own clock has. On the night the user's clocks move to summer time, a time in the skipped hour can't be picked, and a saved one is shown as it is stored, such as 2026-03-08 02:30:00, instead of in the display format. The server rejects a time the picker's own timezone skips.

On the night the clocks go back, a time such as 01:30 happens twice. A saved value that is the second one keeps its offset in the field's state ("2026-11-01 01:30:00-05:00"), so it saves as the same moment. A time picked in the browser is the first one.

Limits

Every picker with a calendar takes:

Limits are worked out again when the form is submitted. On a DateTimePicker, ->minDate('now') therefore moves on while the user fills the form, and a time picked as "now" is in the past by then. A part of a second in a limit rounds to the second the browser can pick.

DatePicker, DateTimePicker, DateRangePicker and MultiDatePicker also take days that can't be picked:

DateTimePicker and TimePicker take times of day:

The server checks every limit too, as a request can hold anything: Laravel's after_or_equal, before_or_equal and in messages. A month or week may be picked when any of its days is within the limits. Text that isn't a date fails with the date message.

Presets and buttons

DatePicker and DateRangePicker take presets. Each picker takes ->todayButton(), ->clearButton() and ->applyButton() one at a time. Your own presets take a token, a date object or text:

Tokens, worked out in the browser on the day the user is on: today, tomorrow, yesterday, in_7_days, last_7_days, last_30_days, next_month, start_of_month, end_of_month, start_of_last_month, end_of_last_month, start_of_year, end_of_year. A preset or Today the limits rule out can't be clicked, and a range preset starting before minDate() starts on it.

Labels are translated; English and Arabic are included. Publish the translations to change them:

Calendar

The calendar follows the panel's colors, dark mode and right-to-left layout.

Languages

The calendar uses the app's locale, with every locale flatpickr ships; only the one in use is sent to the browser. A locale such as pt_BR uses flatpickr's pt, and one flatpickr doesn't have falls back to English. ->locale('fr') sets it for one field.

The calendar follows the page's direction, but its grid of days is laid out left to right even on a right-to-left page, as most users read calendars. ->calendarDirection('rtl') lays the grid out right to left, ->calendarDirection(null) makes it follow the page, and configureUsing() sets it for every picker:

Phones

Phones get the same calendar. ->nativeOnMobile() gives them the browser's own date input instead, without presets, buttons, or the month and week pickers.

Other flatpickr options

options() takes an array or a closure and is merged over what the field sets. It reaches the browser as JSON, so it can't hold functions such as hooks or plugins, and limits set in it are only checked in the browser.

A ->readOnly() field doesn't open.

Upgrading from 4.x

5.0 replaces the Flatpickr field with one class per kind of picker, and keeps the value the browser holds in a fixed format, which removes a family of locale, format and timezone bugs.

Development

License

MIT. See LICENSE.


All versions of filament-flatpickr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/forms Version ^4.0|^5.0
filament/support Version ^4.0|^5.0
illuminate/contracts Version ^11.28|^12.0|^13.0
spatie/laravel-package-tools Version ^1.15.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tareq-alqadi/filament-flatpickr contains the following files

Loading the files please wait ...