HEX
Server: Apache/2.4.46 (Ubuntu)
System: Linux localhost 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64
User: root (0)
PHP: 7.4.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wavecolordrop.com/wp-content/plugins/wps-team/includes/traits/date-methods.php
<?php
namespace WPSpeedo_Team;

if ( ! defined('ABSPATH') ) exit;

trait Date_Methods {

    public function current_time() {
        return current_time('Y-m-d');
    }

    public function date_compare( $date_1, $date_2 = null, $compare = null ) {
        
        if ( ! $compare ) $compare = '==';
        if ( ! $date_2 ) $date_2 = $this->current_time();

        if ( $compare == '<' ) {
            return strtotime( $date_1 ) < strtotime( $date_2 );
        } else if ( $compare == '>' ) {
            return strtotime( $date_1 ) > strtotime( $date_2 );
        } else if ( $compare == '<=' ) {
            return strtotime( $date_1 ) <= strtotime( $date_2 );
        } else if ( $compare == '>=' ) {
            return strtotime( $date_1 ) >= strtotime( $date_2 );
        } else {
            return strtotime( $date_1 ) == strtotime( $date_2 );
        }

    }

    public function date_diff( $date_1, $date_2 = null ) {
        if ( ! $date_2 ) $date_2 = $this->current_time();
        $diff = date_diff( date_create($date_2), date_create($date_1) );
        return $diff->format("%R%a");
    }

    public function date_is_current( $date_1 ) {
        return $this->date_compare( $date_1 );
    }

    public function date_is_prev( $date_1, $date_2 = null ) {
        return $this->date_compare( $date_1, $date_2, '<' );
    }

    public function date_is_current_or_prev( $date_1, $date_2 = null ) {
        return $this->date_compare( $date_1, $date_2, '<=' );
    }

    public function date_is_next( $date_1, $date_2 = null ) {
        return $this->date_compare( $date_1, $date_2, '>' );
    }

    public function date_is_current_or_next( $date_1, $date_2 = null ) {
        return $this->date_compare( $date_1, $date_2, '>=' );
    }

    public function date_increment( $date, $days ) {
        return date( 'Y-m-d', strtotime( $date. " + $days days" ) );
    }

}