izi-dev / nova-field-date-picker
基于 https://vcalendar.io/ 的字段日期
1.0.0
2020-03-30 23:59 UTC
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2024-09-24 09:38:56 UTC
README
描述
基于 https://vcalendar.io/ 的优雅日历和日期选择字段,用于laravel nova。
屏幕截图
安装
此包可以通过Composer安装。
composer require izi-dev/nova-field-date-picker
示例用法
use IziDev\VCalendar\SuperDatePicker; SuperDatePicker::make(__("Birthdate"), 'birthdate') ->required(true) ->rules('required', 'date'),
深色模式
->isDark()
颜色
->color("red") //gray, red, orange, yellow, green, teal, blue, indigo, purple, pink.
内联
->isInline()
禁用日期
->disabledDates("2020-03-23")
->disabledDates("2020-03-25","2020-03-24")
->disabledDates(["2020-03-25","2020-03-26"])
格式
->format("YYYY/MM/DD")
地区
->locale("en")
最小 && 最大日期
->minDate("2020-03-01")
->maxDate("2020-03-31")
高级自定义日期选择器
自定义选择日期
参数: DotAttributeVCalendar, HighlightAttributeVCalendar, BarAttributeVCalendar
点
参数: null, true, gray, red, orange, yellow, green, teal, blue, indigo, purple, pink
use IziDev\VCalendar\Attributes\DotAttributeVCalendar;
->selectAttribute(
(new DotAttributeVCalendar("orange"))
)
高亮
参数: null, true, gray, red, orange, yellow, green, teal, blue, indigo, purple, pink
use IziDev\VCalendar\Attributes\HighlightAttributeVCalendar;
->selectAttribute(
(new HighlightAttributeVCalendar("orange"))
)
条形图
参数: null, true, gray, red, orange, yellow, green, teal, blue, indigo, purple, pink
use IziDev\VCalendar\Attributes\BarAttributeVCalendar;
->selectAttribute(
(new BarAttributeVCalendar("orange"))
)
弹出框
参数: ClickPopoverVCalendar, FocusPopoverVCalendar, HoverPopoverVCalendar
use IziDev\VCalendar\Popover\HoverPopoverVCalendar;
->selectAttribute(
(new BarAttributeVCalendar("orange"))
->popover(new HoverPopoverVCalendar("Fecha de nacimiento"))
)
添加更多选择日期
参数: DotAttributeVCalendar, HighlightAttributeVCalendar, BarAttributeVCalendar
->attributeCalendar(
(new HighlightAttributeVCalendar('red'))
->dates($this->created_at)
->popover(new HoverPopoverVCalendar("Creation Record Contact."))
)
->attributeCalendar(
(new BarAttributeVCalendar('red'))
->dates($this->update_at)
->popover(new HoverPopoverVCalendar("Update Record Contact."))
)
高级自定义禁用
类型
->disabled(new DaysDisabledDatesVCalendar(9, 16))
间隔
->disabled(new WeekdaysDisabledDatesVCalendar(1, 7),new WeeklyIntervalDatesVCalendar(2))