<commit_before>import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import * as moment from 'moment-timezone';
import { Moment } from 'moment';
import { SearchModel } from '../shared/model/search-model';
import { SearchFilter } from '../shared/model/search-filter';
import { SearchDaterangeConfig } from '../../core/shared/model/search-daterange-config';
import { isNullOrUndefined } from '../../core/util/node-utilities';

@Component({
  selector: 'app-search-daterange-picker',
  templateUrl: './search-daterange-picker.component.html',
  styleUrls: ['./search-daterange-picker.component.css'],
  encapsulation: ViewEncapsulation.None
}) // To allow styling of the mat-form-field ViewEncapsulation.None
export class SearchDaterangePickerComponent implements OnInit, OnDestroy {
  private componentDestroyed = new Subject();
  searchModel: SearchModel = new SearchModel();
  formGroup: FormGroup;
  ranges: any;
  showRangeLabelOnInput: boolean;
  showClearButton: boolean;
  showDropdowns: boolean;
  alwaysShowCalendars: boolean;
  placeholder: string;

  @Input()
  searchModel$: Observable<SearchModel>;
  @Input()
  searchDaterangeConfig: SearchDaterangeConfig;
  @Output()
  dateRangeFilterAdded = new EventEmitter<SearchModel>();

  constructor(private fb: FormBuilder) {}

  ngOnInit() {
    this.formGroup = this.fb.group({
      internalDateRange: new FormControl()
    });
    this.searchModel$.takeUntil(this.componentDestroyed).subscribe(searchModel => {
      this.searchModel = searchModel;
    });
<commit_msg>fix bug preventing daterange picker calendar only display (#271)<commit_after>import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import * as moment from 'moment-timezone';
import { Moment } from 'moment';
import { SearchModel } from '../shared/model/search-model';
import { SearchFilter } from '../shared/model/search-filter';
import { SearchDaterangeConfig } from '../../core/shared/model/search-daterange-config';
import { isNullOrUndefined } from '../../core/util/node-utilities';

@Component({
  selector: 'app-search-daterange-picker',
  templateUrl: './search-daterange-picker.component.html',
  styleUrls: ['./search-daterange-picker.component.css'],
  encapsulation: ViewEncapsulation.None
}) // To allow styling of the mat-form-field ViewEncapsulation.None
export class SearchDaterangePickerComponent implements OnInit, OnDestroy {
  private componentDestroyed = new Subject();
  searchModel: SearchModel = new SearchModel();
  formGroup: FormGroup;
  ranges: any = null;
  showRangeLabelOnInput: boolean;
  showClearButton: boolean;
  showDropdowns: boolean;
  alwaysShowCalendars: boolean;
  placeholder: string;

  @Input()
  searchModel$: Observable<SearchModel>;
  @Input()
  searchDaterangeConfig: SearchDaterangeConfig;
  @Output()
  dateRangeFilterAdded = new EventEmitter<SearchModel>();

  constructor(private fb: FormBuilder) {}

  ngOnInit() {
    this.formGroup = this.fb.group({
      internalDateRange: new FormControl()
    });
    this.searchModel$.takeUntil(this.componentDestroyed).subscribe(searchModel => {
      this.searchModel = searchModel;
    });

{'fraction_non_alphanumeric': 0.12738853503184713, 'fraction_numerical': 0.0008685581933989577, 'mean_word_length': 5.029668411867365, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1921052', 'n_tokens_mistral': 985, 'n_tokens_neox': 988, 'n_words': 233}