Exemplo n.º 1
0
    def test_business_days(self):
        from kardboard.util import business_days_between

        wednesday = datetime.datetime(year=2011, month=6, day=1)
        next_wednesday = datetime.datetime(year=2011, month=6, day=8)
        result = business_days_between(wednesday, next_wednesday)
        self.assertEqual(result, 5)

        aday = datetime.datetime(year=2011, month=6, day=1)
        manydayslater = datetime.datetime(year=2012, month=6, day=1)
        result = business_days_between(aday, manydayslater)
        self.assertEqual(result, 262)
Exemplo n.º 2
0
    def test_business_days(self):
        from kardboard.util import business_days_between

        wednesday = datetime.datetime(year=2011, month=6, day=1)
        next_wednesday = datetime.datetime(year=2011, month=6, day=8)
        result = business_days_between(wednesday, next_wednesday)
        self.assertEqual(result, 5)

        aday = datetime.datetime(year=2011, month=6, day=1)
        manydayslater = datetime.datetime(year=2012, month=6, day=1)
        result = business_days_between(aday, manydayslater)
        self.assertEqual(result, 262)
Exemplo n.º 3
0
 def lead_time(self):
     """
     Caclucation of the number of days between the backlogging of a card
     and its completion. Returns None if the card hasn't completed yet.
     """
     if self.done_date:
         return business_days_between(self.backlog_date, self.done_date)
Exemplo n.º 4
0
 def cycle_time(self):
     """
     Caclucation of the number of days between the start of a card
     and its completion. Returns None if the card hasn't completed yet.
     """
     if self.start_date and self.done_date:
         return business_days_between(self.start_date, self.done_date)
Exemplo n.º 5
0
 def lead_time(self):
     """
     Caclucation of the number of days between the backlogging of a card
     and its completion. Returns None if the card hasn't completed yet.
     """
     if self.done_date:
         return business_days_between(self.backlog_date, self.done_date)
Exemplo n.º 6
0
 def cycle_time(self):
     """
     Caclucation of the number of days between the start of a card
     and its completion. Returns None if the card hasn't completed yet.
     """
     if self.start_date and self.done_date:
         return business_days_between(self.start_date, self.done_date)
Exemplo n.º 7
0
    def current_lead_time(self, today=None):
        """
        Caclucation of the number of days between the backlogging of a card
        and a comparison point (defaults to today).
        """
        if not self.backlog_date:
            return None

        if not today:
            today = now()
        return business_days_between(self.backlog_date, today)
Exemplo n.º 8
0
    def current_cycle_time(self, today=None):
        """
        Caclucation of the number of days between the start of a card
        and a comparison point (defaults to today).
        Returns None if the card hasn't started yet.
        """
        if not self.start_date:
            return None

        if not today:
            today = datetime.datetime.now()
        return business_days_between(self.start_date, today)
Exemplo n.º 9
0
    def current_cycle_time(self, today=None):
        """
        Caclucation of the number of days between the start of a card
        and a comparison point (defaults to today).
        Returns None if the card hasn't started yet.
        """
        if not self.start_date:
            return None

        if not today:
            today = now()
        return business_days_between(self.start_date, today)