PHP code example of amidesfahani / nova-world-clock

1. Go to this page and download the library: Download amidesfahani/nova-world-clock library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

amidesfahani / nova-world-clock example snippets


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)
      ];
  }

[...]

}