Making WordPress.org


Ignore:
Timestamp:
04/16/2024 12:41:37 PM (2 years ago)
Author:
amieiro
Message:

Translate: Sync "Translation Events" from GitHub

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event.php

    r13529 r13541  
    33namespace Wporg\TranslationEvents\Event;
    44
     5use DateTimeImmutable;
    56use DateTimeZone;
    67use Exception;
    … …  
    8788        }
    8889
     90        public function is_active(): bool {
     91                $now = new DateTimeImmutable( 'now', new DateTimeZone( 'UTC' ) );
     92                return $now >= $this->start->utc() && $now < $this->end->utc();
     93        }
     94
     95        public function is_past(): bool {
     96                return $this->end->is_in_the_past();
     97        }
     98
    8999        public function timezone(): DateTimeZone {
    90100                return $this->timezone;
Note: See TracChangeset for help on using the changeset viewer.