Wallmander\ElasticsearchIndexer\Model\Indexer::prepareDateTerms PHP Method

prepareDateTerms() protected static method

Author: 10up/ElasticPress
protected static prepareDateTerms ( $post_date_gmt ) : array
$post_date_gmt
return array
    protected static function prepareDateTerms($post_date_gmt)
    {
        $timestamp = strtotime($post_date_gmt);
        $date_terms = ['year' => (int) date('Y', $timestamp), 'month' => (int) date('m', $timestamp), 'week' => (int) date('W', $timestamp), 'dayofyear' => (int) date('z', $timestamp), 'day' => (int) date('d', $timestamp), 'dayofweek' => (int) date('d', $timestamp), 'dayofweek_iso' => (int) date('N', $timestamp), 'hour' => (int) date('H', $timestamp), 'minute' => (int) date('i', $timestamp), 'second' => (int) date('s', $timestamp), 'm' => (int) (date('Y', $timestamp) . date('m', $timestamp))];
        return $date_terms;
    }