<commit_before>import {
  AfterViewInit,
  ChangeDetectionStrategy,
  ChangeDetectorRef,
  Component,
  EventEmitter,
  Input,
  Output,
  Renderer2,
  ViewChild
} from '@angular/core';

import { cloneDate } from './dateUtils';


@Component({
  selector: 'cs-calendar-year',
  templateUrl: 'calendar-year.component.html',
  styleUrls: ['calendar-year.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class CalendarYearComponent implements AfterViewInit {
  @Input() public minDate: Date;
  @Input() public maxDate: Date;
  @Input() public selectedDate: Date;
  @Input() public locale: string;
  @Input() public DateTimeFormat;

  @Output() public yearSelected = new EventEmitter<number>();

  @ViewChild('calendarYearElement') private calendarYearElement;
  @ViewChild('selectedYearElement') private selectedYearElement;

  constructor(
    private cdr: ChangeDetectorRef,
    private renderer: Renderer2
  ) {
  }

  public ngAfterViewInit(): void {
    this.scrollIntoSelectedYear();
    this.cdr.detach();
  }

  public get years(): Array<string> {
    const minYear = this.minDate.getFullYear();
    const maxYear = this.maxDate.getFullYear();
    const years = [];
    const dateCheck = cloneDate(this.selectedDate);

    for (let year = minYear; year <= maxYear; year++) {
      dateCheck.setFullYear(year);
      const yearFormatted = new this.DateTimeFormat(this.locale, {
        year: 'numeric',
      }).format(dateCheck);

      years.push(yearFormatted);
    }

    return years;<commit_msg>fix(datepicker): fix datepicker in ie (#1311)<commit_after>import {
  AfterViewInit,
  ChangeDetectionStrategy,
  ChangeDetectorRef,
  Component,
  EventEmitter,
  Input,
  Output,
  Renderer2,
  ViewChild
} from '@angular/core';

import { cloneDate } from './dateUtils';


@Component({
  selector: 'cs-calendar-year',
  templateUrl: 'calendar-year.component.html',
  styleUrls: ['calendar-year.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class CalendarYearComponent implements AfterViewInit {
  @Input() public minDate: Date;
  @Input() public maxDate: Date;
  @Input() public selectedDate: Date;
  @Input() public locale: string;
  @Input() public DateTimeFormat;

  @Output() public yearSelected = new EventEmitter<number>();

  @ViewChild('calendarYearElement') private calendarYearElement;
  @ViewChild('selectedYearElement') private selectedYearElement;

  constructor(
    private cdr: ChangeDetectorRef,
    private renderer: Renderer2
  ) {
  }

  public ngAfterViewInit(): void {
    this.scrollIntoSelectedYear();
    this.cdr.detach();
  }

  public get years(): Array<string> {
    const minYear = this.minDate.getFullYear();
    const maxYear = this.maxDate.getFullYear();
    const years = [];
    const dateCheck = cloneDate(this.selectedDate);

    for (let year = minYear; year <= maxYear; year++) {
      dateCheck.setFullYear(year);
      years.push(dateCheck.getFullYear());
    }

    return years;
{'fraction_non_alphanumeric': 0.12085704720455306, 'fraction_numerical': 0.002678272514228323, 'mean_word_length': 4.316725978647687, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '3834517', 'n_tokens_mistral': 906, 'n_tokens_neox': 882, 'n_words': 207}