From 951807b5f0de23bdc842ffdf6d796f11629f8762 Mon Sep 17 00:00:00 2001 From: NumEricR <-> Date: Sun, 24 Apr 2011 16:54:38 +0200 Subject: [PATCH] Add "early adopter" mention for user accounts created on first months of Github --- js/githubresume.js | 11 +++++++++-- views/resume.html | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/js/githubresume.js b/js/githubresume.js index 41178c1..ea8535b 100644 --- a/js/githubresume.js +++ b/js/githubresume.js @@ -63,8 +63,9 @@ var run = function() { repos = data; }); - var since = new Date(data.user.created_at); - since = since.getFullYear(); + var sinceDate = new Date(data.user.created_at); + since = sinceDate.getFullYear(); + var sinceMonth = sinceDate.getMonth(); var currentYear = (new Date).getFullYear(); switch (since) { case currentYear-1: @@ -91,6 +92,7 @@ var run = function() { name: name, email: data.user.email, created_at: data.user.created_at, + earlyAdopter: 0, location: data.user.location, gravatar_id: data.user.gravatar_id, repos: data.user.public_repo_count, @@ -103,6 +105,11 @@ var run = function() { view.blog = addHttp + data.user.blog; } + // We consider a limit of 4 months since the Github opening (Feb 2008) to be considered as an early adopter + if (since == '2008' && sinceMonth <= 5) { + view.earlyAdopter = 1; + } + $.ajax({ url: 'views/resume.html', dataType: 'html', diff --git a/views/resume.html b/views/resume.html index c7df071..8df4c79 100644 --- a/views/resume.html +++ b/views/resume.html @@ -36,7 +36,7 @@ based in {{location}} {{/location}} {{#repos}}with {{repos}} public {{plural}}{{/repos}}{{^repos}}without any public repository for now{{/repos}}. - I've been using github.com since {{since}} + I've been using github.com since {{since}}{{#earlyAdopter}}, therefore I'm an early adopter,{{/earlyAdopter}} {{#blog}} and sometimes I blog at {{blog}}. {{/blog}}