Skip to content

๐Ÿ•— A Laravel Nova card to display world clocks

License

Notifications You must be signed in to change notification settings

InteractionDesignFoundation/nova-worldclock-card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

54 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

World Clock Laravel Nova Card

World Clock Laravel Nova Card

A Laravel Nova card to display world clock.

Latest Stable Version Total Downloads

Installation

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

composer require interaction-design-foundation/nova-worldclock-card

Usage

Register your new card.

Basic usage:

use InteractionDesignFoundation\WorldClockCard\WorldClock;

public function cards()
{
  return [
     (new WorldClock())
        ->timezones([
            'Asia/Dubai',
            'America/New_York',
            'Europe/Kiev',
        ]),
  ];
}

Advanced usage:

use InteractionDesignFoundation\WorldClockCard\WorldClock;

public function cards()
{
  return [
     (new WorldClock())
        ->timezones([
            'Asia/Dubai',
            'America/New_York',
            'Europe/Kiev',
        ])
        ->timeFormat('h:i') // Optional, time format. Default is: 'h:i'
        ->updatePeriod(1000) // Optional, to set updating time period in millisecond.
        ->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/Dubai' => 'Yuto, Hana',
            'America/New_York' => 'Mark',
            'Europe/Kiev' => 'Slava, Ukraine',
        ]),
  ];
}

Changelog

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

Contributing

Please see CONTRIBUTING for details.

License

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