Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Created August 9, 2011 13:36
Show Gist options
  • Select an option

  • Save aaronpowell/1134056 to your computer and use it in GitHub Desktop.

Select an option

Save aaronpowell/1134056 to your computer and use it in GitHub Desktop.
amplify.request.define('get-hole-scores', 'ajax', {
url: '/game/scores/{mode}/{id}',
dataType: 'json',
type: 'GET',
cache: 1000,
decoder: function (data, status, xhr, success, error) {
for (var i = 0, il = data.length; i < il; i++) {
data[i].CompletedAt = new Date(parseInt(data[i].CompletedAt.match(dateRegex)[1], 10));
data[i].completionDate = formatDate(data[i].CompletedAt);
}
success(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment