using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DateSelector : MonoBehaviour
{
    public int selectedYear;
    public int selectedMonth;
    public int selectedDay;
    public int selectedHour;
    public int selectedMinute;
    public int duration;

    public void SetYear(int yearIndex)
    {
        selectedYear = yearIndex + 2025; // Achtung: ggf. +Offset je nach Dropdown-Inhalt
    }

    public void SetMonth(int monthIndex)
    {
        selectedMonth = monthIndex + 1; // Januar = 0 in Dropdown → Monat = 1
    }

    public void SetDay(int dayIndex)
    {
        selectedDay = dayIndex + 1; // 1–31
    }

    public void SetHour(int hourIndex)
    {
        selectedHour = hourIndex; // 0–23
    }

    public void SetMinute(int minuteIndex)
    {
        selectedMinute = minuteIndex * 5; // 0–55 in 5er Schritten
    }

    public void SetDuration(int durationIndex)
    {
        duration = durationIndex * 5; // 0–55 in 5er Schritten
    }
    public DateTime selectedDateTime()
    {
        DateTime dateAndTime = new DateTime(selectedYear, selectedMonth, selectedDay, selectedHour, selectedMinute, 0, DateTimeKind.Utc);
        return dateAndTime;
    }

    public DateTime EndTime()
    {
        DateTime dateAndTime = selectedDateTime().AddMinutes(duration);
        return dateAndTime;
    }

}
