Skip to content

Commit

Permalink
Bring back early Date conversion for date/time fields to fix groupping
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Oct 12, 2024
1 parent 9ddd60f commit ed7e135
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion themes/chatview/psi/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function psiThemeAdapter(chat) {
if (this.name == "sender") { //may not be html
d = chat.util.escapeHtml(d);
} else if (d instanceof Date) {
// "date" and "time" variables use TemplateTimeVar. this is something unknown
chat.console("WARNING: " + this.name + " isn't handled by TemplateTimeVar");
d = chat.util.dateFormat(d, shared.dateTimeFormat);
} else if (this.name == "avatarurl") {
var url;
Expand Down
10 changes: 10 additions & 0 deletions themes/chatview/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,16 @@ ${info}
}
}

// we need "time" as Date for groupping.
if (data.time) {
data.time = new Date(data.time);
}

// "date" is not really required that early but why not
if (data.date) {
data.date = new Date(data.date);
}

if (data.type == "message") {
if (data.mtype == "join") {
usersMap[data.sender] = {avatar:data.avatar, nickcolor:data.nickcolor, msgs:{}};
Expand Down

0 comments on commit ed7e135

Please sign in to comment.