PHP Classes

File: README.md

Recommend this page to a friend!
  Classes 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:
Date: 5 years ago
Size: 1,340 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

  public function card()
  {
      return [
         (new WorldClock())
            ->timezones([
                'Asia/Tokyo',
                'Asia/Dubai',
                'America/new_york',
                'America/los_angeles',
            ]),
      ];
  }

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

Format Time ( optional )

Add a different format to the constructor, see http://php.net/manual/en/function.date.php for available formatting options.

For example: 24-hour formatting:

  public function card()
  {
      return [
         (new WorldClock('H:i'))
            ->timezones([
                'Asia/Tokyo',
                'Asia/Dubai',
                'America/new_york',
                'America/los_angeles',
            ]),
      ];
  }

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.