shamimjony1000 commited on
Commit
cac4a15
·
verified ·
1 Parent(s): 915f804

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -24
app.py CHANGED
@@ -25,7 +25,7 @@ def main():
25
 
26
  # Display the tasks in a table format with Task ID
27
 
28
- '''
29
  if st.session_state.tasks:
30
  st.write("Today's Tasks:")
31
  df = pd.DataFrame(st.session_state.tasks)
@@ -33,29 +33,6 @@ def main():
33
  df['Task Duration (minutes)'] = df['Task Duration (minutes)'].astype(int)
34
  st.table(df[['Task ID', 'Task Name', 'Task Time', 'Task Duration (hours)', 'Task Duration (minutes)', 'Category']]) # Include Task ID here
35
 
36
- '''
37
- if st.session_state.tasks:
38
- st.write("Today's Tasks:")
39
-
40
- # Convert session tasks to DataFrame
41
- df = pd.DataFrame(st.session_state.tasks)
42
-
43
- # Ensure that 'Task Time' is in datetime format
44
- df['Task Time'] = pd.to_datetime(df['Task Time'])
45
-
46
- # Filter tasks for today only
47
- today = pd.Timestamp.today().date()
48
- today_tasks = df[df['Task Time'].dt.date == today]
49
-
50
- if not today_tasks.empty:
51
- today_tasks['Task Duration (hours)'] = today_tasks['Task Duration (hours)'].astype(int)
52
- today_tasks['Task Duration (minutes)'] = today_tasks['Task Duration (minutes)'].astype(int)
53
-
54
- # Show today's tasks in a table
55
- st.table(today_tasks[['Task ID', 'Task Name', 'Task Time', 'Task Duration (hours)', 'Task Duration (minutes)', 'Category']])
56
- else:
57
- st.write("No tasks for today.")
58
-
59
 
60
 
61
  # Input field for deleting a task by ID
 
25
 
26
  # Display the tasks in a table format with Task ID
27
 
28
+
29
  if st.session_state.tasks:
30
  st.write("Today's Tasks:")
31
  df = pd.DataFrame(st.session_state.tasks)
 
33
  df['Task Duration (minutes)'] = df['Task Duration (minutes)'].astype(int)
34
  st.table(df[['Task ID', 'Task Name', 'Task Time', 'Task Duration (hours)', 'Task Duration (minutes)', 'Category']]) # Include Task ID here
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
 
38
  # Input field for deleting a task by ID