承接 adtention/nova-datepicker-field 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adtention/nova-datepicker-field

Composer 安装命令:

composer require adtention/nova-datepicker-field

包简介

A Laravel Nova field.

README 文档

README

Tests

A Laravel Nova date field built as a thin wrapper around @vuepic/vue-datepicker.

Compatibility Version
Laravel Nova ^5.0
PHP ^8.4

Installation

composer require adtention/nova-datepicker-field

Usage

Use Datepicker like any other Nova field in your resource:

<?php

use Adtention\DatepickerField\Datepicker;
use Laravel\Nova\Http\Requests\NovaRequest;

public function fields(NovaRequest $request): array
{
    return [
        Datepicker::make('Start Date', 'start_date')
            ->rules(['nullable', 'date']),

        Datepicker::make('End Date', 'end_date')
            ->rules(['required', 'date'])
            ->readonly(fn (NovaRequest $request): bool => $request->isUpdateOrUpdateAttachedRequest()),
    ];
}

The field is a Nova-friendly wrapper around @vuepic/vue-datepicker and is designed for date-only values.

Datepicker extends Laravel\Nova\Fields\Date, so core Nova Date field features are supported.

More examples

Date-range validation:

<?php

use Adtention\DatepickerField\Datepicker;
use Laravel\Nova\Http\Requests\NovaRequest;

public function fields(NovaRequest $request): array
{
    return [
        Datepicker::make('Start Date')
            ->rules(['required', 'date']),

        Datepicker::make('End Date')
            ->rules(['required', 'date', 'after_or_equal:start_date']),
    ];
}

Using regular Nova field APIs on top of the datepicker:

Datepicker::make('Optional Date')
    ->rules(['nullable', 'date'])
    ->help('Leave empty if this date is not applicable.')
    ->readonly(fn (NovaRequest $request): bool => $request->isUpdateOrUpdateAttachedRequest());

Using inherited Nova Date features:

Datepicker::make('Travel Date')
    ->min(now()->toDateString())
    ->max(now()->addYear()->toDateString())
    ->step(1)
    ->locale('da');

Enable multiple date selection with multiple():

use Adtention\DatepickerField\Datepicker;

Datepicker::make('Available Dates', 'available_dates')
    ->multiple();

Supported scope

This package is intentionally lightweight for public package use: it wraps @vuepic/vue-datepicker for Nova, but does not expose the full upstream prop/slot API.

  • Input is normalized to YYYY-MM-DD before submission.
  • The UI automatically follows Nova light/dark mode styling.
  • Since the field extends Nova Date, inherited Date-field behavior (for example min, max, and step) remains available.
  • Advanced vue-datepicker features (for example custom slots, full range/time presets, and all component props) are not guaranteed to be configurable via PHP at this time.

If you need additional functionality, pull requests are welcome as long as the API stays Nova-friendly.

Development

Build for local environment:

git clone https://github.com/adtention/nova-datepicker-field.git
cd nova-datepicker-field
composer install
npm install
npm run dev

Build for release:

npm run prod

Run tests:

php vendor/bin/phpunit

Run a specific test:

php vendor/bin/phpunit --filter=it_defaults_locale_meta_to_the_application_locale

License

MIT

Credits

Developed by Adtention A/S

Adtention Logo

统计信息

  • 总下载量: 1.55k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固