Example #1
0
    def test_is_overdue_checks_correctly(self):
        creation_date = "2020-08-10 13:00:00"
        completion_goal = 5
        self.assertTrue(kronos.is_overdue(creation_date, completion_goal))

        on_time_date = kronos.get_date_time_as_string()
        on_time_goal = 100
        self.assertFalse(kronos.is_overdue(on_time_date, on_time_goal))
Example #2
0
 def get_overdue_items(self):
     rows = []
     for row in self.get_raw_values():
         if row[3] != "NA" and row[4] == "false":
             if kronos.is_overdue(row[1], row[3]):
                 rows.append(row)
     return rows
Example #3
0
 def get_overdue_items(self):
     rows = []
     for row in self.cursor.execute("SELECT * FROM {}".format(
             self.table_name)):
         if row[3] != "NA" and row[4] == "false":
             if kronos.is_overdue(row[1], row[3]):
                 item = self.__format_row(row)
                 rows.append(item)
     return rows
Example #4
0
 def get_overdue_tasks(self):
     rows = []
     for row in self.get_rows():
         date_set = row[3]
         days_to_complete = row[5]
         is_complete = row[6]
         if is_complete == "false":
             if kronos.is_overdue(date_set, days_to_complete):
                 rows.append(row)
     return rows
Example #5
0
 def get_overdue_items(self):
     rows = []
     for row in self.cursor.execute("SELECT * FROM {}".format(self.table_name)):
         if int(row[4]) == 0 and kronos.is_overdue(row[1], row[3]):
             rows.append(row)
     return rows