<?php

$today = get_today_date();
$tomorrow = get_tomorrow_date();

if ($model_info->start_date == $model_info->end_date) {
    if ($model_info->start_date === $today) {
        echo app_lang("today");
    } else if ($model_info->start_date === $tomorrow) {
        echo app_lang("tomorrow");
    } else {
        $date_name = convert_to_jalali($model_info->start_date);
        echo $date_name;
    }
    if (is_date_exists($model_info->start_time) && $model_info->start_time != "00:00:00" || (is_date_exists($model_info->end_time) && $model_info->end_time != "00:00:00")) {
        if (is_date_exists($model_info->start_time)) {
            if (isset($is_reminder)) {
                echo " ".app_lang("hour")." ".date("H:i", strtotime($model_info->start_time));
            }else {
                echo " ".app_lang("hour")." ".date("H:i", strtotime($model_info->start_time))." ".app_lang("until")." ".date("H:i", strtotime($model_info->end_time));
            }
        }
    }
} else {
    $date_name = convert_to_jalali($model_info->start_date);
    echo $date_name;

    if (is_date_exists($model_info->start_time) && $model_info->start_time != "00:00:00" || (is_date_exists($model_info->end_time) && $model_info->end_time != "00:00:00")) {
        if (is_date_exists($model_info->start_time)) {
            echo " ".app_lang("hour")." ".date("H:i", strtotime($model_info->start_time));
        }
    }


    $end_date_name = convert_to_jalali($model_info->end_date); //get short day name from language
    
    echo " ".app_lang("until")." " . $end_date_name;
    if (is_date_exists($model_info->start_time) && $model_info->start_time != "00:00:00" || (is_date_exists($model_info->end_time) && $model_info->end_time != "00:00:00")) {
        if (is_date_exists($model_info->end_time)) {
            echo " ".app_lang("hour")." ".date("H:i", strtotime($model_info->end_time));
        }
    }
}
?>