use YYYY-MM-DD dates in the chat history window so it sorts correctly
This commit is contained in:
parent
9a9aba9e18
commit
b837c9c558
1 changed files with 3 additions and 2 deletions
|
@ -475,7 +475,8 @@ class HistoryWindow:
|
||||||
tim = row[1]
|
tim = row[1]
|
||||||
message = row[4]
|
message = row[4]
|
||||||
local_time = time.localtime(tim)
|
local_time = time.localtime(tim)
|
||||||
date = time.strftime('%x', local_time)
|
date = time.strftime('%Y-%m-%d', local_time)
|
||||||
|
|
||||||
# jid (to which log is assigned to), name, date, message,
|
# jid (to which log is assigned to), name, date, message,
|
||||||
# time (full unix time)
|
# time (full unix time)
|
||||||
model.append((jid, contact_name, date, message, tim))
|
model.append((jid, contact_name, date, message, tim))
|
||||||
|
@ -512,7 +513,7 @@ class HistoryWindow:
|
||||||
cur_month = gtkgui_helpers.make_gtk_month_python_month(cur_month)
|
cur_month = gtkgui_helpers.make_gtk_month_python_month(cur_month)
|
||||||
model = widget.get_model()
|
model = widget.get_model()
|
||||||
# make it a tupple (Y, M, D, 0, 0, 0...)
|
# make it a tupple (Y, M, D, 0, 0, 0...)
|
||||||
tim = time.strptime(model[path][C_UNIXTIME], '%x')
|
tim = time.strptime(model[path][C_UNIXTIME], '%Y-%m-%d')
|
||||||
year = tim[0]
|
year = tim[0]
|
||||||
gtk_month = tim[1]
|
gtk_month = tim[1]
|
||||||
month = gtkgui_helpers.make_python_month_gtk_month(gtk_month)
|
month = gtkgui_helpers.make_python_month_gtk_month(gtk_month)
|
||||||
|
|
Loading…
Add table
Reference in a new issue