Example #1
0
 def get_last_workday(self):
     rows = []
     for row in self.get_rows():
         if kronos.get_day_of_week(kronos.get_date_time()) == "Monday":
             if kronos.is_previous_friday(row[3]):
                 rows.append(row)
         if kronos.is_yesterday(row[3]):
             rows.append(row)
     return rows
Example #2
0
 def get_last_days_items(self):
     rows = []
     for row in self.get_raw_values():
         if kronos.get_day_of_week(kronos.get_date_time()) == "Monday":
             if kronos.is_previous_friday(row[1]):
                 rows.append(row)
         if kronos.is_yesterday(row[1]):
             rows.append(row)
     return rows
Example #3
0
 def get_last_days_items(self):
     rows = []
     for row in self.cursor.execute("SELECT * FROM {}".format(
             self.table_name)):
         if kronos.get_day_of_week(kronos.get_date_time()) == "Monday":
             if kronos.is_previous_friday(row[1]):
                 item = self.__format_row(row)
                 rows.append(item)
         if kronos.is_yesterday(row[1]):
             item = self.__format_row(row)
             rows.append(item)
     return rows
Example #4
0
 def update_table_with_todo_and_goal(self, note, completion_goal):
     self.rows_in_table = self.rows_in_table + 1
     self.cursor.execute(
         "INSERT INTO {} ({}, {}, {}, {}, {}) VALUES (?, ?, ?, ?, ?)".format(self.table_name, *self.schema),
         (self.rows_in_table, kronos.get_date_time(), note, completion_goal, "0"))
     self.connection.commit()
Example #5
0
 def update_table_with_note(self, note):
     self.rows_in_table = self.rows_in_table + 1
     self.cursor.execute(
         "INSERT INTO {} ({}, {}, {}, {}, {}) VALUES (?, ?, ?, ?, ?)".format(self.table_name, *self.schema),
         (self.rows_in_table, kronos.get_date_time(), note, "-1", "-1"))
     self.connection.commit()