<commit_before>define(function (require) {

  var moment = require('moment'),
      AppDispatcher = require('dispatchers/AppDispatcher'),
      ImageConstants = require('constants/ImageConstants');

  return {

    updateImageAttributes: function (image, newAttributes) {
      if(newAttributes.end_date != null) {
        var end_date;
        if (typeof newAttributes.end_date === "object") {
            end_date = newAttributes.end_date
        } else {
            end_date = moment(newAttributes.end_date);
        }
        newAttributes.end_date = end_date;
      }
      image.set({
        name: newAttributes.name,
        description: newAttributes.description,
        end_date: newAttributes.end_date,
        tags: newAttributes.tags
      });
      AppDispatcher.handleRouteAction({
        actionType: ImageConstants.IMAGE_UPDATE,
        payload: {image: image}
      });
    }

  };

});<commit_msg>Include format when constructing moment.js object<commit_after>define(function (require) {

  var moment = require('moment'),
      AppDispatcher = require('dispatchers/AppDispatcher'),
      ImageConstants = require('constants/ImageConstants');

  return {

    updateImageAttributes: function (image, newAttributes) {
      if(newAttributes.end_date != null) {
        var end_date;
        if (typeof newAttributes.end_date === "object") {
            end_date = newAttributes.end_date
        } else {
            end_date = moment(newAttributes.end_date, "M/DD/YYYY hh:mm a z");
        }
        newAttributes.end_date = end_date;
      }
      image.set({
        name: newAttributes.name,
        description: newAttributes.description,
        end_date: newAttributes.end_date,
        tags: newAttributes.tags
      });
      AppDispatcher.handleRouteAction({
        actionType: ImageConstants.IMAGE_UPDATE,
        payload: {image: image}
      });
    }

  };

});
{'fraction_non_alphanumeric': 0.10817941952506596, 'fraction_numerical': 0.0, 'mean_word_length': 2.5841209829867675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '361876', 'n_tokens_mistral': 527, 'n_tokens_neox': 515, 'n_words': 97}