amidesfahani / nova-world-clock
Laravel Nova 卡片。
v0.1
2020-10-09 12:38 UTC
Requires
- php: >=7.1.0
- laravel/nova: *
README
用于显示世界时钟的 Laravel Nova 卡片
安装
您可以通过 composer 将此包安装到使用 Nova 的 Laravel 应用中
composer require amidesfahani/nova-world-clock
用法
将以下代码添加到 app/Providers/NovaServiceProvider.php 中
namespace App\Providers; [...] use AmidEsfahani\NovaWorldClock\NovaWorldClock; class NovaServiceProvider extends NovaApplicationServiceProvider { [...] public function card() { return [ (new NovaWorldClock()) ->timezones([ 'Asia/Tehran', 'America/new_york', 'America/los_angeles', ]) ->timeFormat('h:i') //Optional time format default is: 'h:i:s' ->updatePeriod(1000) //Optional to set updating time period in millisecond default is 1000 ms = 1 second ->title(__('World Clock')) ->showTitle(true) ]; } [...] }
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅许可证文件。