from datetime import datetime


def get_duration_minutes(endhour, endminute):
    """Return the minutes left until the schedule's end-hour and end-minute are reached."""
    currenttime = datetime.today()
    endtime = datetime(
        currenttime.year, currenttime.month, currenttime.day, endhour, endminute)
    d = endtime - currenttime
    return int(round(d.seconds / 60.0))