idf / nova-worldclock-card

A Laravel Nova card to display world clocks

Stars
3

World Clock Laravel Nova Card

Latest Stable Version
Total Downloads

A Laravel Nova card to display world clock.

image

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require idf/nova-worldclock-card

Usage

Register your new card.

use IDF\WorldClockCard\WorldClock;

public function cards()
{
  return [
     (new WorldClock())
        ->timezones([
            'Asia/Tokyo',
            'Asia/Dubai',
            '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 (1sec)
        ->nightRange(22, 6) // Optional, to set range of night hours. Default is [19; 6).
        ->hideContinents() // Optional, hide continents from timezone-names.
        ->timezoneDescriptions([ // Optional, add text description to timezones.
            'Asia/Tokyo' => 'Yuto, Hana', 
            'Asia/Dubai' => 'Alya, Omar, Ibrahim', 
        ])
  ];
}

Changelog

Please see Releases for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Compiling Assets

# Compile and minify your assets:
npm run prod

# Compile your assets for local development:
npm run dev

# Run the NPM "watch" command to auto-compile your assets when they are changed:
npm run watch

License

The MIT License (MIT). Please see License File for more information.