Array_To_CSV.php
3 years ago
Date_Format.php
3 years ago
Exact_Range.php
3 years ago
Number_Formatter.php
3 years ago
Option.php
3 years ago
Relative_Range.php
3 years ago
Request.php
3 years ago
Salt.php
3 years ago
Security.php
3 years ago
Singleton.php
3 years ago
String_Util.php
3 years ago
Timezone.php
3 years ago
URL.php
3 years ago
WP_Async_Request.php
3 years ago
Exact_Range.php
24 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP_SCOPED\IAWP\Utils; |
| 4 | |
| 5 | class Exact_Range |
| 6 | { |
| 7 | public $label; |
| 8 | public $start; |
| 9 | public $end; |
| 10 | public function __construct($start, $end) |
| 11 | { |
| 12 | $tz = Timezone::local_timezone(); |
| 13 | $this->start = new \DateTime($start, $tz); |
| 14 | $this->end = new \DateTime($end, $tz); |
| 15 | $this->label = $this->get_label(); |
| 16 | } |
| 17 | private function get_label() |
| 18 | { |
| 19 | $formatted_start = $this->start->format(Date_Format::php()); |
| 20 | $formatted_end = $this->end->format(Date_Format::php()); |
| 21 | return $formatted_start . ' - ' . $formatted_end; |
| 22 | } |
| 23 | } |
| 24 |