<commit_before>/**
 * @class CM_FormField_Date
 * @extends CM_FormField_Abstract
 */
var CM_FormField_Date = CM_FormField_Abstract.extend({
  _class: 'CM_FormField_Date',

  ready: function() {
    var dateSource;
    if (Modernizr.inputtypes.date && Modernizr.touchevents) {
      $('.fancySelect').toggle(false);
      dateSource = this.$('[type=date]').toggle(true);
    } else {
      dateSource = this.$('select');
    }
    this.bindJquery(dateSource, 'change', function() {
      this.trigger('change');
    });
  },

  isEmpty: function(value) {
    return _.isEmpty(value.day) || _.isEmpty(value.month) || _.isEmpty(value.year);
  }
});<commit_msg>Enable an user agent detection for HTML5 date.<commit_after>/**
 * @class CM_FormField_Date
 * @extends CM_FormField_Abstract
 */
var CM_FormField_Date = CM_FormField_Abstract.extend({
  _class: 'CM_FormField_Date',

  ready: function() {
    var dateSource;
    if (this._browserHasSpinningDatePicker()) {
      $('.fancySelect').toggle(false);
      dateSource = this.$('[type=date]').toggle(true);
    } else {
      dateSource = this.$('select');
    }
    this.bindJquery(dateSource, 'change', function() {
      this.trigger('change');
    });
  },

  isEmpty: function(value) {
    return _.isEmpty(value.day) || _.isEmpty(value.month) || _.isEmpty(value.year);
  },

  _browserHasSpinningDatePicker: function() {
    return /Android|iPhone|iPad|iPod|IEMobile/i.test(navigator.userAgent);
  }
});
{'fraction_non_alphanumeric': 0.16575342465753426, 'fraction_numerical': 0.0006849315068493151, 'mean_word_length': 3.87, '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': '4526101', 'n_tokens_mistral': 491, 'n_tokens_neox': 479, 'n_words': 76}