File size: 1,282 Bytes
2f4671c
 
 
 
 
 
 
 
 
 
 
ce555bb
2f4671c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import datetime
import pandas as pd

current_time = datetime.datetime.now()
#print(current_time)
current_time, current_minute = datetime.datetime.time(current_time).hour, datetime.datetime.time(current_time).minute
#print('Current time:', current_time)
#print('Current minute: ', current_minute)
current_date = datetime.datetime.date(datetime.datetime.today())
#print('Current date:', current_date)

agenda_worksheet = 'agenda.xlsx'
agenda = pd.read_excel(agenda_worksheet)
#print(agenda)

description, responsible, hour_agenda = [], [], []
for index, row in agenda.iterrows():
    #print(index)
    #print(row)
    date = datetime.datetime.date(row['date'])
    #print(date)
    complete_hour = datetime.datetime.strptime(str(row['hour']), '%H:%M:%S')
    #print(complete_hour)
    hour = datetime.datetime.time(complete_hour).hour
    #print(hour)

    if current_date == date:
        if hour >= current_time:
            description.append(row['description'])
            responsible.append(row['responsible'])
            hour_agenda.append(row['hour'])

#print(description)
#print(responsible)
#print(hour_agenda)

def load_agenda():
    if description:
        return description, responsible, hour_agenda
    else:
        return False

#print(load_agenda())