@@ -79,7 +79,9 @@ function psiThemeAdapter(chat) {
79
79
session : session ,
80
80
isMuc : session . isMuc ,
81
81
accountId : window . srvSession . account ,
82
- dateFormat : "HH:MM:SS" ,
82
+ timeFormat : "HH:mm:ss" ,
83
+ dateFormat : "LL" ,
84
+ dateTimeFormat : "LL HH:mm:ss" ,
83
85
scroller : null ,
84
86
varHandlers : { } ,
85
87
prevGrouppingData : null ,
@@ -94,7 +96,7 @@ function psiThemeAdapter(chat) {
94
96
95
97
TemplateTimeVar : function ( name , format ) {
96
98
this . name = name ;
97
- this . formatter = new chat . DateTimeFormatter ( format || shared . dateFormat ) ;
99
+ this . formatter = new chat . DateTimeFormatter ( format || ( name == "date" ? shared . dateFormat : shared . timeFormat ) ) ;
98
100
} ,
99
101
100
102
TemplateTemplateVar : function ( template_name ) {
@@ -155,7 +157,9 @@ function psiThemeAdapter(chat) {
155
157
}
156
158
var t = shared . templates ;
157
159
shared . chatElement = config . chatElement ;
160
+ shared . timeFormat = config . timeFormat || shared . timeFormat ;
158
161
shared . dateFormat = config . dateFormat || shared . dateFormat ;
162
+ shared . dateTimeFormat = config . dateTimeFormat || shared . dateTimeFormat ;
159
163
shared . scroller = config . scroller || new chat . WindowScroller ( false ) ;
160
164
shared . groupping = config . groupping || shared . groupping ;
161
165
proxy = config . proxy ;
@@ -231,11 +235,8 @@ function psiThemeAdapter(chat) {
231
235
if ( this . name == "sender" ) { //may not be html
232
236
d = chat . util . escapeHtml ( d ) ;
233
237
} else if ( d instanceof Date ) {
234
- if ( this . name == "time" ) {
235
- d = chat . util . dateFormat ( d , shared . dateFormat ) ;
236
- } else { // last message date ?
237
- d = chat . util . dateFormat ( d , "LL" ) ;
238
- }
238
+ // "date" and "time" variables use TemplateTimeVar. this is something unknown
239
+ d = chat . util . dateFormat ( d , shared . dateTimeFormat ) ;
239
240
} else if ( this . name == "avatarurl" ) {
240
241
var url ;
241
242
if ( shared . cdata . local ) {
0 commit comments