michielfb/laravel-nova-time-field
最新稳定版本:2.1.0
Composer 安装命令:
composer require michielfb/laravel-nova-time-field
包简介
A HTML5 time field for Laravel Nova.
README 文档
README
This package adds a basic HTML5 time field to Laravel Nova.
Requirements
This package require laravel/nova:~4.0.
Installation
Use composer to install the package.
composer require michielfb/laravel-nova-time-field
Usage
The example below shows how to create a Time field where users can enter hours, minutes, and seconds. The time is show in the "h:i A" format (For example 11:15 PM). When no value is entered the value "n/a" is shown.
use Michielfb\Time\Time; Time::make('Time') ->withSeconds() ->format('h:i A', 'n/a');
For documentation on how to add fields to a resource see the Laravel Nova documentation.
Format
Use the format method to customize how to date is shown to users. The format must be a
PHP date format.
A default value can be passed to the format method. This determines the value shown to users if there is no
value entered.
use Michielfb\Time\Time; Time::make('Time') ->format('h:i A', '-');
Steps
The step attribute
can be configured by using the withSteps method.
<?php use Michielfb\Time\Time; Time::make('Time')->withSteps(1);
The withSeconds method sets a step of 1 which allows users to enter seconds.
<?php use Michielfb\Time\Time; Time::make('Time')->withSeconds();
The withMilliseconds method sets a step of 0.001 which allows users to enter milliseconds.
<?php use Michielfb\Time\Time; Time::make('Time')->withMilliseconds();
统计信息
- 总下载量: 383.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-01