lara-pack/livewire-date-range-picker
Composer 安装命令:
composer require lara-pack/livewire-date-range-picker
包简介
Livewire Component : Date Range Picker
README 文档
README
A modern and easy-to-integrate Date Range Picker component for Livewire. This package is designed to work seamlessly with both Livewire 3 and Livewire 4.
Features ✨
- Compatibility: Supports Livewire 3 & 4.
- Time Support: Built-in support for time selection.
- Customizable: Fully configurable via properties (min/max date, format, locale, etc.).
- Responsive: Works perfectly on various devices and screen sizes.
- Modelable: Uses the
#[Modelable]attribute for seamlesswire:modelintegration.
Installation 🚀
Install the package via Composer:
composer require lara-pack/livewire-date-range-picker
Requirements 📦
This component depends on Bootstrap DateRangePicker. You need to include the following CSS and JS files in your layout (typically in app.blade.php):
<!-- Dependencies (jQuery, Moment.js, and DateRangePicker) --> <script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js" ></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js" ></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js" ></script> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
Usage 🛠️
Basic Usage
Add the component to your Blade view:
<livewire:lara-pack.livewire-date-range-picker wire:model="range" class="form-control" />
Tip
In Livewire 4, if you require instant data synchronization, you can use wire:model.live. However, this component already handles synchronization automatically when a date range is selected.
In your parent Livewire component:
public $range = []; // Will contain ['YYYY-MM-DD', 'YYYY-MM-DD']
Advanced Configuration
You can customize the picker's behavior through the following properties:
<livewire:lara-pack.livewire-date-range-picker wire:model="range" class="form-control" :showDropdowns="true" :timePicker="true" opens="center" :autoApply="true" :locale="[ 'format' => 'DD/MM/YYYY', 'separator' => ' to ', 'applyLabel' => 'Apply', 'cancelLabel' => 'Cancel', ]" />
Available Properties 📝
| Property | Type | Default | Description |
|---|---|---|---|
class |
string |
'' |
CSS class for the input element. |
disabled |
boolean |
false |
Disables the input. |
minDate |
string |
null |
Minimum selectable date. |
maxDate |
string |
null |
Maximum selectable date. |
showDropdowns |
boolean |
true |
Show year and month select dropdowns. |
timePicker |
boolean |
false |
Enable time selection. |
timePicker24Hour |
boolean |
true |
Use 24-hour format for the time picker. |
opens |
string |
'right' |
Open direction: left, right, or center. |
drops |
string |
'down' |
Drop direction: down or up. |
autoApply |
boolean |
false |
Apply the range immediately upon selection. |
Contributing 🤝
Contributions are highly welcome! Feel free to open an Issue or submit a Pull Request for any feature enhancements or bug fixes.
License 📜
This package is licensed under the MIT License.
lara-pack/livewire-date-range-picker 适用场景与选型建议
lara-pack/livewire-date-range-picker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 lara-pack/livewire-date-range-picker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lara-pack/livewire-date-range-picker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-30