| | |
| | | <?php |
| | | |
| | | use JVBase\base\options; |
| | | use JVBase\base\Options; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\Meta; |
| | | |
| | |
| | | { |
| | | // Get hours data if not provided |
| | | if ($hours_data === null) { |
| | | $hours_data = options::get('openingHours'); |
| | | $hours_data = Options::get('openingHours'); |
| | | } |
| | | |
| | | // Return false if no hours data |
| | |
| | | * @throws DateInvalidTimeZoneException |
| | | * @throws DateMalformedStringException |
| | | */ |
| | | function jvbIsTimeBetween(?string $start_time = null, ?string $end_time = null, string $timezone = 'America/Edmonton'):bool { |
| | | function jvbIsTimeBetween(?string $start_time = null, ?string $end_time = null):bool { |
| | | if (!$start_time && !$end_time) { |
| | | $hours = options::get('today_hours'); |
| | | $hours = Options::get('today_hours'); |
| | | $start_time = $hours['time_start']; |
| | | $end_time = $hours['time_end']; |
| | | } |
| | | |
| | | // Get current time in specified timezone |
| | | $current_time = new DateTime('now', new DateTimeZone($timezone)); |
| | | $current_time = new DateTime('now', wp_timezone()); |
| | | $current_time_string = $current_time->format('H:i'); |
| | | |
| | | // Normalize time formats (handle with or without seconds) |