Skip to content

Instantly share code, notes, and snippets.

@dinocarl
Created May 27, 2016 16:52
Show Gist options
  • Save dinocarl/f945bbfedee172ce5cfbec0eee9b8797 to your computer and use it in GitHub Desktop.
Save dinocarl/f945bbfedee172ce5cfbec0eee9b8797 to your computer and use it in GitHub Desktop.
fetch: function fetch(options) {
// populate serverTime with the date response header
options = options || {};
options.method = 'HEAD';
options.success = function (model, response, options){
model.set({
serverTime: options.xhr.getResponseHeader('Date')
});
};
Backbone.Model.prototype.fetch.call(this, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment