Detect strftime year/month/day specifiers in weechat.look.buffer_time_format
Accodingly include year/month/day into our time format.
This commit is contained in:
parent
a20a9b7dfb
commit
02a3fbb876
|
@ -77,6 +77,10 @@ weechat.factory('connection',
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var _timeDelimiter = function(delim) {
|
||||||
|
return "'<span class=\"cof-chat_time_delimiters cob-chat_time_delimiters coa-chat_time_delimiters\">" + delim + "</span>'";
|
||||||
|
};
|
||||||
|
|
||||||
var _parseWeechatTimeFormat = function() {
|
var _parseWeechatTimeFormat = function() {
|
||||||
// Fetch the buffer time format from weechat
|
// Fetch the buffer time format from weechat
|
||||||
var timeFormat = models.wconfig['weechat.look.buffer_time_format'];
|
var timeFormat = models.wconfig['weechat.look.buffer_time_format'];
|
||||||
|
@ -88,7 +92,7 @@ weechat.factory('connection',
|
||||||
// one of four formats, (short|long) (12|24)-hour time
|
// one of four formats, (short|long) (12|24)-hour time
|
||||||
var angularFormat = "";
|
var angularFormat = "";
|
||||||
|
|
||||||
var timeDelimiter = "'<span class=\"cof-chat_time_delimiters cob-chat_time_delimiters coa-chat_time_delimiters\">:</span>'";
|
var timeDelimiter = _timeDelimiter(":");
|
||||||
|
|
||||||
var left12 = "hh" + timeDelimiter + "mm";
|
var left12 = "hh" + timeDelimiter + "mm";
|
||||||
var right12 = "' 'a";
|
var right12 = "' 'a";
|
||||||
|
@ -132,6 +136,19 @@ weechat.factory('connection',
|
||||||
angularFormat = short24;
|
angularFormat = short24;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (timeFormat.indexOf("%d") > -1) {
|
||||||
|
angularFormat = "dd" + _timeDelimiter(" ") + angularFormat;
|
||||||
|
if (timeFormat.indexOf("%m") > -1) {
|
||||||
|
angularFormat = "MM" + _timeDelimiter("-") + angularFormat;
|
||||||
|
if (timeFormat.indexOf("%y") > -1) {
|
||||||
|
angularFormat = "yy" + _timeDelimiter("-") + angularFormat;
|
||||||
|
}
|
||||||
|
if (timeFormat.indexOf("%Y") > -1) {
|
||||||
|
angularFormat = "yyyy" + _timeDelimiter("-") + angularFormat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$rootScope.angularTimeFormat = angularFormat;
|
$rootScope.angularTimeFormat = angularFormat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue