<commit_before>angular.module('mdDatetime')
.component('mdDatetime', {
  require: {
    modelCtrl: 'ngModel'
  },
  template: require('html!./md-datetime.html'),
  controller($attrs) {
    this.$onInit = () => {
      this.modelCtrl.$render = () => {
        this.datetime = moment(this.modelCtrl.$modelValue);
        this.updateParams();
      };
    };

    this.updateDate = () => {
      let newDate = moment(this.params.date);

      this.datetime.year(newDate.year());
      this.datetime.month(newDate.month());
      this.datetime.date(newDate.date());

      this.updateParams();
    };

    this.updateTime = () => {
      this.datetime.hour(this.params.time.hour);
      this.datetime.minute(this.params.time.minute);

      this.updateParams();
    };

    this.updateParams = () => {
      this.params = {
        date: this.datetime.toDate(),
        time: {
          hour: this.datetime.hour(),
          minute: this.datetime.minute()
        }
      };

      this.modelCtrl.$setViewValue(this.datetime.toISOString());
    };

    this.canReset = !('noReset' in $attrs);

    this.reset = () => {
      this.datetime = moment();
      this.updateParams();
    };
  },
  controllerAs: 'DT'
});<commit_msg>do not trigger ngChange on init<commit_after>angular.module('mdDatetime')
.component('mdDatetime', {
  require: {
    modelCtrl: 'ngModel'
  },
  template: require('html!./md-datetime.html'),
  controller($attrs) {
    this.$onInit = () => {
      this.modelCtrl.$render = () => {
        this.datetime = moment(this.modelCtrl.$modelValue);
        this.updateParams(true);
      };
    };

    this.updateDate = () => {
      let newDate = moment(this.params.date);

      this.datetime.year(newDate.year());
      this.datetime.month(newDate.month());
      this.datetime.date(newDate.date());

      this.updateParams();
    };

    this.updateTime = () => {
      this.datetime.hour(this.params.time.hour);
      this.datetime.minute(this.params.time.minute);

      this.updateParams();
    };

    this.updateParams = (init) => {
      this.params = {
        date: this.datetime.toDate(),
        time: {
          hour: this.datetime.hour(),
          minute: this.datetime.minute()
        }
      };

      if (init) { return; }
      this.modelCtrl.$setViewValue(this.datetime.toISOString());
    };

    this.canReset = !('noReset' in $attrs);

    this.reset = () => {
      this.datetime = moment();
      this.updateParams();
    };
  },
  controllerAs: 'DT'
});
{'fraction_non_alphanumeric': 0.178, 'fraction_numerical': 0.0, 'mean_word_length': 2.375168690958165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '6225004', 'n_tokens_mistral': 793, 'n_tokens_neox': 774, 'n_words': 99}