PHP code example of itsnubix / nowcal

1. Go to this page and download the library: Download itsnubix/nowcal 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/ */

    

itsnubix / nowcal example snippets


use NowCal\NowCal;

$event = NowCal::create(['start' => 'October 5, 2019 6:03PM']))
  ->summary('Daft Punk is playing')
  ->location('My House');

$props = [
  'start' => 'now',
  'end' => 'now + 1 hour',
  // OR
  'duration' => '28d 6h 42m 12s',
  'summary' => 'Daft Punk is playing',
  'location' => 'My House',
];

// Creates a NowCal instance
$nowcal = new NowCal($props); // or NowCal::create($props);

// Exports a raw output array
$nowcal->raw; // or NowCal::raw($props)

// Exports a plain text version
$nowcal->plain; // or NowCal::plain($props)

// Exports a path to a tempfile
$nowcal->file; // or NowCal::file($props)