laraning/nova-time-field
Composer 安装命令:
composer require laraning/nova-time-field
包简介
A Laravel Nova field.
README 文档
README
This package contains a Nova field to allow you to store time values. Under the hood it uses the flatpickr default Laravel Nova Calendar library.
Installation
You can install this package in your Laravel Nova app via composer:
composer require laraning/nova-time-field
Usage
You can use the Laraning\NovaTimeField\TimeField namespace in your Nova resource:
namespace App\Nova; use Laraning\NovaTimeField\TimeField; class BlogPost extends Resource { // ... public function fields(Request $request) { return [ // ... TimeField::make('Post start Time'), // ... ]; } }
By default the time component uses a 24 hour format. Still you can make it in 12h format like:
TimeField::make('Post start Time')->withTwelveHourTime(),
You can also change the default 5 minute increments to another number:
TimeField::make('Post start Time')->minuteIncrement(1),
You can make sure that all times entered are converted back to your base app timezone (set in config/app.php) by calling
the withTimezoneAdjustments() method on your field.
TimeField::make('Post start Time')->withTimezoneAdjustments(),
An example of this would be when your app is set to GMT but your user is in BST (GMT+1). The user would still be able to interact with the timefield in their local time, but the time would be saved into the database in GMT.
E.G. The user may select 14:00. They will always see the time as 14:00, but the database will save it as 13:00 as it makes the BST -> GMT adjustments behind the scenes.
As well as handling switching the time to and from your base app timezone, you may also pass in a timezone offset (in minutes),
such as the one returned by moment().utcOffset(). This will then adjust the time to display with the adjusted timezone
rather than the users timezone. This is useful if you're saving the time in UTC along with the offset of the browser that
was used to submit it.
Here you can see how we'd move UTC to BST by passing an offset of 60
TimeField::make('Post start Time')->withTimezoneAdjustments(60),
Current development status
- Make release 0.1.0.
- Add minimal test scenarios.
- Add timezone support.
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
laraning/nova-time-field 适用场景与选型建议
laraning/nova-time-field 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 751.59k 次下载、GitHub Stars 达 61, 最近一次更新时间为 2018 年 09 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「nova」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 laraning/nova-time-field 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laraning/nova-time-field 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 laraning/nova-time-field 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
A Laravel Nova Image field. you can paste or drag or chose an image
A Laravel Nova Mail testing tool.
统计信息
- 总下载量: 751.59k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 61
- 点击次数: 17
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-26