forked from 0x2620/pandora
unify date parsing and fall back to raw value if it failed
This commit is contained in:
parent
72358a7bce
commit
4e4d64febc
3 changed files with 24 additions and 18 deletions
|
|
@ -1115,6 +1115,27 @@ pandora.formatDocumentKey = function(key, data, size) {
|
|||
return value;
|
||||
}
|
||||
|
||||
pandora.formatDate = function(value) {
|
||||
var ret;
|
||||
if (!value) {
|
||||
ret = ''
|
||||
} else if (Ox.contains(value, ':') && value.split('-').length == 3) {
|
||||
ret = Ox.formatDate(value,
|
||||
['', '', '%B %e, %Y %H:%M', '%B %e, %Y %H:%M:%S'][value.split(':').length],
|
||||
false
|
||||
);
|
||||
} else {
|
||||
ret = Ox.formatDate(value,
|
||||
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length],
|
||||
true
|
||||
);
|
||||
}
|
||||
if (ret.trim() == 'NaN') {
|
||||
ret = value;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
pandora.getAllItemsTitle = function(section) {
|
||||
section = section || pandora.user.ui.section;
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue