PHP Classes

File: README.md

Recommend this page to a friend!
  Packages of Naif Alshaye   PHP World Clock   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP World Clock
Display the time in different time zones
Author: By
Last change: doc
Add further explanation of implentation on README
Update README.md
Update README.md
Date: 7 months ago
Size: 1,217 bytes
 

Contents

Class file image Download

World Clock

A Laravel Nova card to display world clock

Installation:

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

composer require naif/world-clock

Usage:

Add the below to app/Providers/NovaServiceProvder.php

namespace App\Providers;

[...]

use Naif\WorldClock\WorldClock;

class NovaServiceProvider extends NovaApplicationServiceProvider
{

[...]

  public function card()
  {
      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 = 1 second
      ];
  }

[...]

}

<img src="https://raw.githubusercontent.com/naifalshaye/worldclock/master/screenshots/screenshot.png" width="350">

Credits

Abdullah Algethami

Support:

naif@naif.io

https://www.linkedin.com/in/naif

License:

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