PHP code example of interaction-design-foundation / nova-worldclock-card

1. Go to this page and download the library: Download interaction-design-foundation/nova-worldclock-card 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/ */

    

interaction-design-foundation / nova-worldclock-card example snippets


use InteractionDesignFoundation\WorldClockCard\WorldClock;

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

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