<commit_before>import Ember from 'ember';
import layout from './template';
import { range } from 'date-range-picker/helpers/range';
import moment from 'moment';

const {
  computed,
  Component,
  run
} = Ember;

export default Component.extend({
  allYearsOffset: 10,
  isExpanded: false,
  layout,
  tagName: "span",
  month: moment(),
  energyYear: false,

  didRender() {
    if (this.get('isExpanded')) {
      run.next(this, () => {
        let year = this.get('insideYearPicker') ? this.get('startDate').year() : this.get('month').year();
        let $container = this.$('.dp-year-body');
        let $scrollTo = this.$(`button.dp-btn-year-option:contains(${year})`);
        if ($container && $container.length && $scrollTo && $scrollTo.length) {
            $container.scrollTop(
              $scrollTo.offset().top - $container.offset().top + $container.scrollTop()
            );
            $container.animate({
              scrollTop: $scrollTo.offset().top - $container.offset().top + $container.scrollTop()
            }, 0);
          }
      });
    }
  },

  allYears: computed('startDate', 'insideYearPicker', 'allYearsOffset', 'month', function() {
    let year = this.get('insideYearPicker') ? this.get('startDate').year() : this.get('month').year();
    let offset = this.get('allYearsOffset');

    return range(year - offset, year + offset + 1);
  }),

  setCalendarYear(year) {
    let day = this.get('startDate').date();
    let month = this.get('startDate').format("MM");
    let startDate = moment(`${year}-${month}-${day}`, 'YYYY-MM-DD');
    let endDate = moment(year, "YYYY").endOf('year');
<commit_msg>Make Sure Start Date is Set<commit_after>import Ember from 'ember';
import layout from './template';
import { range } from 'date-range-picker/helpers/range';
import moment from 'moment';

const {
  computed,
  Component,
  run
} = Ember;

export default Component.extend({
  allYearsOffset: 10,
  isExpanded: false,
  layout,
  tagName: "span",
  month: moment(),
  energyYear: false,

  didRender() {
    if (this.get('isExpanded')) {
      run.next(this, () => {
        let year = this.get('insideYearPicker') && this.get('startDate') ? this.get('startDate').year() : this.get('month').year();
        let $container = this.$('.dp-year-body');
        let $scrollTo = this.$(`button.dp-btn-year-option:contains(${year})`);
        if ($container && $container.length && $scrollTo && $scrollTo.length) {
            $container.scrollTop(
              $scrollTo.offset().top - $container.offset().top + $container.scrollTop()
            );
            $container.animate({
              scrollTop: $scrollTo.offset().top - $container.offset().top + $container.scrollTop()
            }, 0);
          }
      });
    }
  },

  allYears: computed('startDate', 'insideYearPicker', 'allYearsOffset', 'month', function() {
    let year = this.get('insideYearPicker') ? this.get('startDate').year() : this.get('month').year();
    let offset = this.get('allYearsOffset');

    return range(year - offset, year + offset + 1);
  }),

  setCalendarYear(year) {
    let day = this.get('startDate').date();
    let month = this.get('startDate').format("MM");
    let startDate = moment(`${year}-${month}-${day}`, 'YYYY-MM-DD');
    let endDate = moment(year, "YYYY").endOf('year');

{'fraction_non_alphanumeric': 0.18816067653276955, 'fraction_numerical': 0.0024161884627000906, 'mean_word_length': 3.1142857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5697900', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1027, 'n_words': 206}