Exemple #1
0
 def _update_excluded_dates(self):
     """
     We need to update dates inside ExcludedDates and the recurrence library
     """
     exdates = []
     for excluded in ExcludedDates.objects.filter(schedule=self):
         new_excluded_dt = excluded.get_new_excluded_datetime(self.start_dt)
         excluded.datetime = new_excluded_dt
         excluded.save()
         exdates.append(fix_recurrence_date(self.start_dt, new_excluded_dt))
     self.recurrences.exdates = exdates
Exemple #2
0
 def _update_excluded_dates(self):
     """
     We need to update dates inside ExcludedDates and the recurrence library
     """
     exdates = []
     for excluded in ExcludedDates.objects.filter(schedule=self):
         new_excluded_dt = excluded.get_new_excluded_datetime(self.start_dt)
         excluded.datetime = new_excluded_dt
         excluded.save()
         exdates.append(fix_recurrence_date(self.start_dt, new_excluded_dt))
     self.recurrences.exdates = exdates
Exemple #3
0
 def include_date(self, dt):
     local_dt = transform_dt_to_default_tz(dt)
     self.recurrences.exdates.remove(fix_recurrence_date(self.start_dt, local_dt))
     ExcludedDates.objects.get(schedule=self, datetime=dt).delete()
Exemple #4
0
 def exclude_date(self, dt):
     local_dt = transform_dt_to_default_tz(dt)
     self.recurrences.exdates.append(fix_recurrence_date(self.start_dt, local_dt))
     ExcludedDates.objects.create(schedule=self, datetime=dt)
Exemple #5
0
 def include_date(self, dt):
     local_dt = transform_dt_to_default_tz(dt)
     self.recurrences.exdates.remove(fix_recurrence_date(self.start_dt, local_dt))
     ExcludedDates.objects.get(schedule=self, datetime=dt).delete()
Exemple #6
0
 def exclude_date(self, dt):
     local_dt = transform_dt_to_default_tz(dt)
     self.recurrences.exdates.append(fix_recurrence_date(self.start_dt, local_dt))
     ExcludedDates.objects.create(schedule=self, datetime=dt)