<?php
/**
 * Partial template to display top header date.
 *
 * @package purenote
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$purenote_header_date_enable = purenote_get_customizer_option_value( 'purenote_header_date_enable' );

if ( false === $purenote_header_date_enable ) {
    return;
}

$purenote_header_date_format = purenote_get_customizer_option_value( 'purenote_header_date_format' );

switch ( $purenote_header_date_format ) {
    case 'date_format_2':
        $date_format = 'l, d F, Y'; // Monday, 01 January, 2023
        break;

    default:
        $date_format = 'l, d M, Y'; // Monday, 01 Jan, 2023
        break;
}

$datetime = date_i18n( $date_format, current_datetime( 'timestamp' ) );
?>

<div class="header-date-wrap">
    <span class="date"><?php echo esc_html( $datetime ); ?></span>
</div><!-- .header-date-wrap -->
