Changeset - 0ff919f1c283
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2012-07-05 16:48:56
marcin@python-works.com
Fixed sorting by data when using custom date format from settings
3 files changed with 14 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -1251,10 +1251,15 @@ var get_group_name = function(node){
 
	return name
 
}
 
var get_date = function(node){
 
	var date_ = node.firstElementChild.innerHTML;
 
	var date_ = YUD.getAttribute(node.firstElementChild,'date');
 
	return date_
 
}
 

	
 
var get_age = function(node){
 
	console.log(node);
 
	return node
 
}
 

	
 
var revisionSort = function(a, b, desc, field) {
 
	  
 
	  var a_ = fromHTML(a.getData(field));
 
@@ -1269,8 +1274,12 @@ var revisionSort = function(a, b, desc, 
 
	  return compState;
 
};
 
var ageSort = function(a, b, desc, field) {
 
    var a_ = a.getData(field);
 
    var b_ = b.getData(field);
 
    var a_ = fromHTML(a.getData(field));
 
    var b_ = fromHTML(b.getData(field));
 
    
 
    // extract name from table
 
    a_ = get_date(a_)
 
    b_ = get_date(b_)          
 
    
 
    var comp = YAHOO.util.Sort.compare;
 
    var compState = comp(a_, b_, desc);
rhodecode/templates/admin/repos/repos.html
Show inline comments
 
@@ -56,7 +56,7 @@
 
              </td>
 
              ##LAST CHANGE
 
              <td>
 
                <span class="tooltip" title="${h.tooltip(repo['last_change'])}">${h.age(repo['last_change'])}</span>
 
                <span class="tooltip" date="${repo['last_change']}" title="${h.tooltip(repo['last_change'])}">${h.age(repo['last_change'])}</span>
 
              </td>
 
              ##LAST REVISION
 
              <td>
rhodecode/templates/index_base.html
Show inline comments
 
@@ -89,7 +89,7 @@
 
                    </td>
 
                    ##LAST CHANGE DATE
 
                    <td>
 
                      <span class="tooltip" title="${h.tooltip(h.fmt_date(repo['last_change']))}">${h.age(repo['last_change'])}</span>
 
                      <span class="tooltip" date="${repo['last_change']}" title="${h.tooltip(h.fmt_date(repo['last_change']))}">${h.age(repo['last_change'])}</span>
 
                    </td>
 
                    ##LAST REVISION
 
                    <td>
0 comments (0 inline, 0 general)