Fix negative number of weeks at year boundary
git-svn-id: http://google-refine.googlecode.com/svn/trunk@2421 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
fa2e6fe608
commit
3af6487f44
@ -70,6 +70,7 @@ function formatRelativeDate(d) {
|
||||
return (diff <= 1) ? ("yesterday " + d.toString("h:mm tt")) : (diff + " days ago");
|
||||
} else if (d.between(last_month, today)) {
|
||||
var diff = Math.floor((today.getDayOfYear() - d.getDayOfYear()) / 7);
|
||||
if (diff < 1) {diff += 52};
|
||||
return (diff == 1) ? "a week ago" : diff.toFixed(0) + " weeks ago" ;
|
||||
} else if (d.between(almost_last_year, today)) {
|
||||
var diff = today.getMonth() - d.getMonth();
|
||||
|
Loading…
Reference in New Issue
Block a user