Version date format and time ago + Fix folder toggle class

This commit is contained in:
brunosimon
2016-06-07 01:18:11 +02:00
parent f659020706
commit 6e32b80ddd
5 changed files with 32 additions and 9 deletions
+7 -1
View File
@@ -99,6 +99,12 @@ angular_module.factory(
// Reformat versions
result.each_version( data, function( version )
{
// Date
version.moment_date = moment( version.date );
version.date_formated = version.moment_date.format( 'LTS' );
version.time_from_now = version.moment_date.fromNow();
// Differencies
var count = 0,
modified = 0;
@@ -115,7 +121,7 @@ angular_module.factory(
var _diff = version.diff[ _diff_key ];
count += _diff.count;
if( _diff.removed || _diff.added )
if( _diff.added /*|| _diff.removed*/ )
modified += _diff.count;
}
version.diff_ratio = modified / count;