izi-dev/nova-field-date-picker

基于 https://vcalendar.io/ 的字段日期

1.0.0 2020-03-30 23:59 UTC

This package is auto-updated.

Last update: 2024-09-24 09:38:56 UTC


README

GitHub license

描述

基于 https://vcalendar.io/ 的优雅日历和日期选择字段,用于laravel nova。

屏幕截图

Screenshot1 Screenshot2

安装

此包可以通过Composer安装。

composer require izi-dev/nova-field-date-picker

示例用法

use IziDev\VCalendar\SuperDatePicker;

SuperDatePicker::make(__("Birthdate"), 'birthdate')
    ->required(true)
    ->rules('required', 'date'),

Screenshot3

深色模式

->isDark()

Screenshot4

颜色

->color("red") //gray, red, orange, yellow, green, teal, blue, indigo, purple, pink.

Screenshot6

内联

->isInline() 

Screenshot5

禁用日期

->disabledDates("2020-03-23")
->disabledDates("2020-03-25","2020-03-24")
->disabledDates(["2020-03-25","2020-03-26"])

Screenshot7

格式

->format("YYYY/MM/DD")

Screenshot8

地区

->locale("en")

Screenshot9

最小 && 最大日期

->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"))
)

Screenshot11

高亮

参数: null, true, gray, red, orange, yellow, green, teal, blue, indigo, purple, pink

use IziDev\VCalendar\Attributes\HighlightAttributeVCalendar;

->selectAttribute(
    (new HighlightAttributeVCalendar("orange"))
)

Screenshot12

条形图

参数: null, true, gray, red, orange, yellow, green, teal, blue, indigo, purple, pink

use IziDev\VCalendar\Attributes\BarAttributeVCalendar;

->selectAttribute(
    (new BarAttributeVCalendar("orange"))
)

Screenshot13

弹出框

参数: ClickPopoverVCalendar, FocusPopoverVCalendar, HoverPopoverVCalendar

use IziDev\VCalendar\Popover\HoverPopoverVCalendar;

->selectAttribute(
    (new BarAttributeVCalendar("orange"))
        ->popover(new HoverPopoverVCalendar("Fecha de nacimiento"))
)

Screenshot14

添加更多选择日期

参数: 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."))
)

Screenshot15

高级自定义禁用

类型

->disabled(new DaysDisabledDatesVCalendar(9, 16))

间隔

->disabled(new WeekdaysDisabledDatesVCalendar(1, 7),new WeeklyIntervalDatesVCalendar(2))

Screenshot16