<commit_before>import { Directive, ElementRef, Inject, Input, OnInit } from '@angular/core';
import TinyDatePicker from 'tiny-date-picker';

@Directive({
  selector: '[sprkDatepicker]'
})
export class SprkDatepickerDirective implements OnInit {
  constructor(public ref: ElementRef) {}

  @Input()
  sprkDatePickerConfig: object;

  ngOnInit(): void {
    const input = this.ref.nativeElement;
    const tdpConfig = {
      mode: 'dp-below',
      lang: {
        days: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
      },
      min: '01/1/2008',
      max: '01/1/2068',
      format: date =>
        date
          .toLocaleDateString('en-US', {
            month: '2-digit',
            day: '2-digit',
            year: 'numeric'
          })
          .replace(/[^ -~]/g, '')
    };

    if (TinyDatePicker) {
      TinyDatePicker(input, {
        ...tdpConfig,
        ...this.sprkDatePickerConfig
      }).on('select', () => {

        let event;

        if(typeof(Event) === 'function') {
          event = new Event('input');
        }else{
          event = document.createEvent('Event');
          event.initEvent('input', true, true);
        }

        this.ref.nativeElement.dispatchEvent(event);
        this.ref.nativeElement.focus();
      });
    }
  }
}<commit_msg>spacing<commit_after>import { Directive, ElementRef, Inject, Input, OnInit } from '@angular/core';
import TinyDatePicker from 'tiny-date-picker';

@Directive({
  selector: '[sprkDatepicker]'
})
export class SprkDatepickerDirective implements OnInit {
  constructor(public ref: ElementRef) {}

  @Input()
  sprkDatePickerConfig: object;

  ngOnInit(): void {
    const input = this.ref.nativeElement;
    const tdpConfig = {
      mode: 'dp-below',
      lang: {
        days: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
      },
      min: '01/1/2008',
      max: '01/1/2068',
      format: date =>
        date
          .toLocaleDateString('en-US', {
            month: '2-digit',
            day: '2-digit',
            year: 'numeric'
          })
          .replace(/[^ -~]/g, '')
    };

    if (TinyDatePicker) {
      TinyDatePicker(input, {
        ...tdpConfig,
        ...this.sprkDatePickerConfig
      }).on('select', () => {

        let event;

        if (typeof(Event) === 'function') {
          event = new Event('input');
        } else {
          event = document.createEvent('Event');
          event.initEvent('input', true, true);
        }

        this.ref.nativeElement.dispatchEvent(event);
        this.ref.nativeElement.focus();
      });
    }
  }
}
{'fraction_non_alphanumeric': 0.16712436249509613, 'fraction_numerical': 0.012553942722636328, 'mean_word_length': 2.072289156626506, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2021745', 'n_tokens_mistral': 840, 'n_tokens_neox': 799, 'n_words': 163}