from PyQt6 import QtWidgets

from .dialog_sources.Ui_reminder import Ui_Erinnerung as Ui_Dialog
from src import Icon
import datetime as date


class ReminderDialog(QtWidgets.QDialog, Ui_Dialog):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setupUi(self)
        self.setWindowIcon(Icon("notification").icon)
        self.setWindowTitle("Erinnerung")
        self.dateEdit.setDate(date.datetime.now())

    def return_message(self) -> dict:
        return {
            "message": self.message_box.toPlainText(),
            "remind_at": self.dateEdit.date().toString("yyyy-MM-dd"),
        }
