Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
e63e417e
Commit
e63e417e
authored
Jul 29, 2013
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the date displayed for calls in the history menus
parent
278d33fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
history.py
blink/history.py
+12
-13
No files found.
blink/history.py
View file @
e63e417e
...
...
@@ -10,7 +10,7 @@ from application.notification import IObserver, NotificationCenter
from
application.python
import
Null
from
application.python.types
import
Singleton
from
collections
import
deque
from
datetime
import
datetime
from
datetime
import
date
,
date
time
from
zope.interface
import
implements
from
sipsimple.account
import
BonjourAccount
...
...
@@ -133,17 +133,16 @@ class HistoryEntry(object):
return
u'
%
s
%
s
%
s
%
s'
%
(
self
.
remote_identity
,
time
,
duration
,
reason
)
def
format_date
(
dt
):
now
=
datetime
.
now
()
delta
=
now
-
dt
if
(
dt
.
year
,
dt
.
month
,
dt
.
day
)
==
(
now
.
year
,
now
.
month
,
now
.
day
):
return
dt
.
strftime
(
"at
%
H:
%
M"
)
elif
delta
.
days
<=
1
:
return
"Yesterday at
%
s"
%
dt
.
strftime
(
"
%
H:
%
M"
)
elif
delta
.
days
<
7
:
return
dt
.
strftime
(
"on
%
A"
)
elif
delta
.
days
<
300
:
return
dt
.
strftime
(
"on
%
B
%
d"
)
def
format_date
(
when
):
days
=
(
date
.
today
()
-
when
.
date
())
.
days
if
days
==
0
:
return
when
.
strftime
(
"at
%
H:
%
M"
)
elif
days
==
1
:
return
when
.
strftime
(
"Yesterday at
%
H:
%
M"
)
elif
days
<
7
:
return
when
.
strftime
(
"on
%
A"
)
elif
days
<
365
:
return
when
.
strftime
(
"on
%
B
%
d"
)
else
:
return
dt
.
strftime
(
"on
%
Y-
%
m-
%
d"
)
return
when
.
strftime
(
"on
%
Y-
%
m-
%
d"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment