Show opening hours for a site
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
550 B

<?php
namespace MABEL_BHI_LITE\Models
{
if(!defined('ABSPATH')){die;}
use DateTime;
class Special_Date
{
public $date;
public $opening_hours;
public $is_today;
public function __construct(DateTime $date)
{
$this->date = $date;
$this->opening_hours = array();
}
public function is_closed()
{
return sizeof($this->opening_hours) === 0;
}
public function to_string()
{
return sprintf('%s %s',
$this->date->format('j'),
$this->date->format('M')
);
}
}
}