<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/humane.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,4 +3,6 @@
 - Strip unnecessary functions from prototype (the biggest lib) [DONE] (prototype removed)
 - make BRANCH=master default and branch argument optional [DONE]
 - &quot;Show files&quot; link which expands the box and shows which files were added/removed/changed [DONE]
+
 - Make things configurable (in github-commit-badge.js), like: dateformat, commit-message-length, gravatar size
+- Rewrite the whole thing in jQuery to make it prettier and more portable</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,19 @@ function truncate(string, length, truncation) {
       string.slice(0, length - truncation.length) + truncation : string;
 };
 
+function parseDate(dateTime) {	// thanks to lachlanhardy
+	var timeZone = -1;	// or &quot;-3&quot; as appropriate
+
+	dateTime = dateTime.substring(0,19) + &quot;Z&quot;;
+	var theirTime = dateTime.substring(11,13);
+	var ourTime = parseInt(theirTime) + 7 + timeZone;
+	if (ourTime &gt; 24) {
+		ourTime = ourTime - 24;
+	};
+	dateTime = dateTime.replace(&quot;T&quot; + theirTime, &quot;T&quot; + ourTime);
+	return dateTime;
+};
+
 function mainpage () {
 jQuery.each(Badges, function(i, badgeData) {
 
@@ -50,19 +63,16 @@ jQuery.getJSON(&quot;http://github.com/api/v1/json/&quot; + badgeData[&quot;username&quot;] + &quot;/&quot; +
 		myLink.setAttribute(&quot;href&quot;,myEval.commit.url);
 		myLink.setAttribute(&quot;class&quot;, &quot;github-commit-badge-badge&quot;);
 		myLink.appendChild(document.createTextNode(&quot; &quot; + truncate(myEval.commit.id,10,&quot;&quot;)));
-		myDiffLine.appendChild(document.createTextNode(myEval.commit.committer.name + &quot; &quot;));
-		var mySpan = document.createElement(&quot;span&quot;);
-		mySpan.setAttribute(&quot;class&quot;,&quot;github-commit-badge-text&quot;);
-		mySpan.appendChild(document.createTextNode(&quot;committed&quot;));
+		myDiffLine.appendChild(document.createTextNode(myEval.commit.committer.name + &quot; committed &quot;));
 		
 		var myDate = document.createElement(&quot;span&quot;);
-		myDate.setAttribute(&quot;class&quot;,&quot;github-commit-badge-text&quot;);
-		var myParsedDate = Date.parse(myEval.commit.committed_date).toString(&quot;yyyy-MM-dd @ HH:mm&quot;);
-		myDate.appendChild(document.createTextNode(myParsedDate));
+		var dateTime = parseDate(myEval.commit.committed_date);
+		myDate.setAttribute(&quot;class&quot;, &quot;github-commit-badge-text-date&quot;);
+		myDate.setAttribute(&quot;title&quot;, dateTime);
+		myDate.appendChild(document.createTextNode(dateTime));
 		
-		myDiffLine.appendChild(mySpan);
 		myDiffLine.appendChild(myLink);
-		myDiffLine.appendChild(document.createElement(&quot;span&quot;).appendChild(document.createTextNode(&quot; on &quot;)));
+		myDiffLine.appendChild(document.createTextNode(&quot; about &quot;));
 		myDiffLine.appendChild(myDate);
 		
 		// myCommitMessage is the commit-message
@@ -149,6 +159,7 @@ jQuery.getJSON(&quot;http://github.com/api/v1/json/&quot; + badgeData[&quot;username&quot;] + &quot;/&quot; +
 			};
 			return false;
 		});
+		$(&quot;.github-commit-badge-text-date&quot;).humane_dates();	// works here (still, ugly!)
 });
 });
 };</diff>
      <filename>github-commit-badge.js</filename>
    </modified>
    <modified>
      <diff>@@ -409,3 +409,141 @@ if(s instanceof Date){return s;}
 try{r=$D.Grammar.start.call({},s.replace(/^\s*(\S*(\s+\S+)*)\s*$/,&quot;$1&quot;));}catch(e){return null;}
 return((r[1].length===0)?r[0]:null);};$D.getParseFunction=function(fx){var fn=$D.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
 return((r[1].length===0)?r[0]:null);};};$D.parseExact=function(s,fx){return $D.getParseFunction(fx)(s);};}());
+/*
+ * Javascript Humane Dates
+ * Copyright (c) 2008 Dean Landolt (deanlandolt.com)
+ * Re-write by Zach Leatherman (zachleat.com)
+ * 
+ * Adopted from the John Resig's pretty.js
+ * at http://ejohn.org/blog/javascript-pretty-date
+ * and henrah's proposed modification 
+ * at http://ejohn.org/blog/javascript-pretty-date/#comment-297458
+ * 
+ * Licensed under the MIT license.
+ */
+
+function humane_date(date_str){
+	var time_formats = [
+		[60, 'Just Now'],
+		[90, '1 minute'], // 60*1.5
+		[3600, 'minutes', 60], // 60*60, 60
+		[5400, '1 hour'], // 60*60*1.5
+		[86400, 'hours', 3600], // 60*60*24, 60*60
+		[129600, '1 day'], // 60*60*24*1.5
+		[604800, 'days', 86400], // 60*60*24*7, 60*60*24
+		[907200, '1 week'], // 60*60*24*7*1.5
+		[2628000, 'weeks', 604800], // 60*60*24*(365/12), 60*60*24*7
+		[3942000, '1 month'], // 60*60*24*(365/12)*1.5
+		[31536000, 'months', 2628000], // 60*60*24*365, 60*60*24*(365/12)
+		[47304000, '1 year'], // 60*60*24*365*1.5
+		[3153600000, 'years', 31536000], // 60*60*24*365*100, 60*60*24*365
+		[4730400000, '1 century'], // 60*60*24*365*100*1.5
+	];
+
+	var time = ('' + date_str).replace(/-/g,&quot;/&quot;).replace(/[TZ]/g,&quot; &quot;),
+		dt = new Date,
+		seconds = ((dt - new Date(time) + (dt.getTimezoneOffset() * 60000)) / 1000),
+		token = ' Ago',
+		i = 0,
+		format;
+
+	if (seconds &lt; 0) {
+		seconds = Math.abs(seconds);
+		token = '';
+	}
+
+	while (format = time_formats[i++]) {
+		if (seconds &lt; format[0]) {
+			if (format.length == 2) {
+				return format[1] + (i &gt; 1 ? token : ''); // Conditional so we don't return Just Now Ago
+			} else {
+				return Math.round(seconds / format[2]) + ' ' + format[1] + (i &gt; 1 ? token : '');
+			}
+		}
+	}
+
+	// overflow for centuries
+	if(seconds &gt; 4730400000)
+		return Math.round(seconds / 4730400000) + ' Centuries' + token;
+
+	return date_str;
+};
+
+if(typeof jQuery != 'undefined') {
+	jQuery.fn.humane_dates = function(){
+		return this.each(function(){
+			var date = humane_date(this.title);
+			if(date &amp;&amp; jQuery(this).text() != date) // don't modify the dom if we don't have to
+				jQuery(this).text(date);
+		});
+	};
+}
+/*
+ * Javascript Humane Dates
+ * Copyright (c) 2008 Dean Landolt (deanlandolt.com)
+ * Re-write by Zach Leatherman (zachleat.com)
+ * 
+ * Adopted from the John Resig's pretty.js
+ * at http://ejohn.org/blog/javascript-pretty-date
+ * and henrah's proposed modification 
+ * at http://ejohn.org/blog/javascript-pretty-date/#comment-297458
+ * 
+ * Licensed under the MIT license.
+ */
+
+function humane_date(date_str){
+	var time_formats = [
+		[60, 'Just Now'],
+		[90, '1 minute'], // 60*1.5
+		[3600, 'minutes', 60], // 60*60, 60
+		[5400, '1 hour'], // 60*60*1.5
+		[86400, 'hours', 3600], // 60*60*24, 60*60
+		[129600, '1 day'], // 60*60*24*1.5
+		[604800, 'days', 86400], // 60*60*24*7, 60*60*24
+		[907200, '1 week'], // 60*60*24*7*1.5
+		[2628000, 'weeks', 604800], // 60*60*24*(365/12), 60*60*24*7
+		[3942000, '1 month'], // 60*60*24*(365/12)*1.5
+		[31536000, 'months', 2628000], // 60*60*24*365, 60*60*24*(365/12)
+		[47304000, '1 year'], // 60*60*24*365*1.5
+		[3153600000, 'years', 31536000], // 60*60*24*365*100, 60*60*24*365
+		[4730400000, '1 century'], // 60*60*24*365*100*1.5
+	];
+
+	var time = ('' + date_str).replace(/-/g,&quot;/&quot;).replace(/[TZ]/g,&quot; &quot;),
+		dt = new Date,
+		seconds = ((dt - new Date(time) + (dt.getTimezoneOffset() * 60000)) / 1000),
+		token = ' ago',
+		i = 0,
+		format;
+
+	if (seconds &lt; 0) {
+		seconds = Math.abs(seconds);
+		token = '';
+	}
+
+	while (format = time_formats[i++]) {
+		if (seconds &lt; format[0]) {
+			if (format.length == 2) {
+				return format[1] + (i &gt; 1 ? token : ''); // Conditional so we don't return Just Now Ago
+			} else {
+				return Math.round(seconds / format[2]) + ' ' + format[1] + (i &gt; 1 ? token : '');
+			}
+		}
+	}
+
+	// overflow for centuries
+	if(seconds &gt; 4730400000)
+		return Math.round(seconds / 4730400000) + ' centuries' + token;
+
+	return date_str;
+};
+
+if(typeof jQuery != 'undefined') {
+	jQuery.fn.humane_dates = function(){
+		return this.each(function(){
+			var date = humane_date(this.title);
+			if(date &amp;&amp; jQuery(this).text() != date) // don't modify the dom if we don't have to
+				jQuery(this).text(date);
+		});
+	};
+}</diff>
      <filename>lib/everything.js</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>lib/everything.jsgz</filename>
    </modified>
    <modified>
      <diff>@@ -67,7 +67,7 @@ a.github-commit-badge-username:hover {
 	text-decoration: none;
 }
 
-span.github-commit-badge-text {
+span.github-commit-badge-text, span.github-commit-badge-text-date {
 	color: black;
 	background-color: #fff6a9;
 }</diff>
      <filename>style.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8341aa0b9e200827e17815cf4c6381a4ae22b2ee</id>
    </parent>
  </parents>
  <author>
    <name>Johannes Gilger</name>
    <email>heipei@hackvalue.de</email>
  </author>
  <url>http://github.com/heipei/github-commit-badge/commit/5a66ac4d532ad874ce5fe1de9e3b0a78f96eb1f9</url>
  <id>5a66ac4d532ad874ce5fe1de9e3b0a78f96eb1f9</id>
  <committed-date>2009-01-21T07:32:32-08:00</committed-date>
  <authored-date>2009-01-21T07:20:50-08:00</authored-date>
  <message>Use humane_date to format commit date

- github-commit-badge.js: Use humane_date to change the ugly timestamps
- lib/everything.{js,jsgz}: Include humane.js
- lib: Include humane.js for debugging
- style.css: new class for distinguishing dates</message>
  <tree>69fc43dd4417911a2b191ad3bf90ce8a8d06bdc5</tree>
  <committer>
    <name>Johannes Gilger</name>
    <email>heipei@hackvalue.de</email>
  </committer>
</commit>
