Skip to content
Snippets Groups Projects
Commit bc10c82c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow time format to be set via modopts.ini [logonlist] time_fmt

... in strftime format (https://cplusplus.com/reference/ctime/strftime/)

If you (sysop) have last_few_callers_fmt set to a custom value in your
modopts.ini, you'll need to update that format as a result of this change:
the number and type of arguments have now changed: instead of the logon
time be passed as hours and minutes (integers), it's now passed as a single
a string. That string is the result of a call to strftime() with the time_fmt
or (by default), "%H:%M".

This change was made to accommodate request by NeoArata (THEREALM)
parent b45c2678
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -73,16 +73,14 @@ function print(hdr, num, days_ago)
console.putmsg(hdr);
for(var i in list) {
var record = list[i];
var date = new Date(record.time * 1000);
console.print(format(options.last_few_callers_fmt ||
"\r\n\x01n\x01h\x01m%-3s\x01n\x01m%-6s \x01w\x01h%-25.25s \x01m%-25.25s" +
"\x01n\x01m%2u:%02u \x01h%-8.8s\x01n\x01m%4u"
"\x01n\x01m%s \x01h%-8.8s\x01n\x01m%4u"
,record.total ? record.node : ""
,record.total ? record.total : ""
,record.user.alias
,(system.settings & SYS_LISTLOC) ? record.user.location : record.user.note
,date.getHours()
,date.getMinutes()
,strftime(options.time_fmt || "%H:%M", record.time)
,record.protocol || record.user.connection
,record.user.stats.logons_today
));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment