function sjr_last_date_status() {

    $last_date = get_post_meta(get_the_ID(), 'last_date', true);

    if (empty($last_date)) {
        return 'No Date';
    }

    $timestamp = strtotime($last_date);

    if (!$timestamp) {
        return 'Invalid Date';
    }

    $now = current_time('timestamp');

    $diff = ceil(($timestamp - $now) / DAY_IN_SECONDS);

    if ($diff < 0) {
        return '<span style="color:#DC2626;font-weight:600;">Expired</span>';
    }

    if ($diff == 0) {
        return '<span style="color:#EA580C;font-weight:600;">Last Date Today</span>';
    }

    if ($diff == 1) {
        return '<span style="color:#F97316;font-weight:600;">1 Day Left</span>';
    }

    return '<span style="color:#16A34A;font-weight:600;">' . $diff . ' Days Left</span>';
}

add_shortcode('last_date_status', 'sjr_last_date_status');<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://statejobresult.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://statejobresult.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://statejobresult.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://statejobresult.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://statejobresult.com/wp-sitemap-taxonomies-post_tag-1.xml</loc></sitemap><sitemap><loc>https://statejobresult.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
