Skip to content

Commit f606082

Browse files
committed
Fix date calculations
1 parent 8e5ad54 commit f606082

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitconsensus/repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ def daysSinceLastCommit(self):
154154
# 2017-08-19T23:29:31Z
155155
commit_date = datetime.datetime.strptime(commit_date_string, '%Y-%m-%dT%H:%M:%SZ')
156156
now = datetime.datetime.now()
157-
delta = commit_date - now
157+
delta = now - commit_date
158158
return delta.days
159159

160160
def daysSincePullOpened(self):
161161
now = datetime.datetime.now()
162-
delta = self.pr.created_at.replace(tzinfo=None) - now
162+
delta = now - self.pr.created_at.replace(tzinfo=None)
163163
return delta.days
164164

165165
def daysSinceLastUpdate(self):

0 commit comments

Comments
 (0)