mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-07 16:12:10 +01:00
added "time ago" as {0} to formatTimestamp
This commit is contained in:
@@ -32,14 +32,21 @@
|
||||
Ext.apply(Ext.util.Format, {
|
||||
|
||||
formatTimestamp: function(value){
|
||||
var date = null;
|
||||
var result = '';
|
||||
if ( value != null && (value > 0 || value.length > 0)){
|
||||
var df = state.clientConfig.dateFormat;
|
||||
if ( df == null || df.length == 0 || ! Ext.isDefined(value) ){
|
||||
df = "Y-m-d H:i:s";
|
||||
}
|
||||
result = Ext.util.Format.date(new Date(value), df);
|
||||
date = new Date(value);
|
||||
result = Ext.util.Format.date(date, df);
|
||||
}
|
||||
|
||||
if (date != null && result.indexOf("{0}") >= 0){
|
||||
result = String.format( result, Ext.util.Format.timeAgo(date) );
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user