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

import * as rawPikaday from 'pikaday';
const Pikaday = (rawPikaday as any).default ? (rawPikaday as any).default : rawPikaday;

import * as rawMoment from 'moment';
const moment = (rawMoment as any).default ? (rawMoment as any).default : rawMoment;

/**
 * TODO: parent project must include (in .angular-cli.json):
 *   ../node_modules/pikaday/css/pikaday.css
 *   ../node_modules/pikaday/css/triangle.css
 */
@Component({
  moduleId: module.id,
  selector: 'prx-datepicker',
  templateUrl: './datepicker.component.html',
  styleUrls: ['./datepicker.component.css']
})

export class DatepickerComponent implements AfterViewInit {
  public static FORMAT = 'MM/DD/YYYY';

  _date: Date;
  @Input()
  set date(value: Date) {
    if (!this._date || (value && this._date.valueOf() !== value.valueOf())) {
      this._date = new Date(value.valueOf());
      if (this.picker) {
        // if UTC, adjust picker date accordingly
        const pickerDate = this.UTC ? this.pickerUTCOffset(this._date) : this._date;
        this.picker.setDate(pickerDate);<commit_msg>check date value for undefined<commit_after>import { Component, Input, Output, EventEmitter, AfterViewInit, ViewChild,
  ElementRef } from '@angular/core';

import * as rawPikaday from 'pikaday';
const Pikaday = (rawPikaday as any).default ? (rawPikaday as any).default : rawPikaday;

import * as rawMoment from 'moment';
const moment = (rawMoment as any).default ? (rawMoment as any).default : rawMoment;

/**
 * TODO: parent project must include (in .angular-cli.json):
 *   ../node_modules/pikaday/css/pikaday.css
 *   ../node_modules/pikaday/css/triangle.css
 */
@Component({
  moduleId: module.id,
  selector: 'prx-datepicker',
  templateUrl: './datepicker.component.html',
  styleUrls: ['./datepicker.component.css']
})

export class DatepickerComponent implements AfterViewInit {
  public static FORMAT = 'MM/DD/YYYY';

  _date: Date;
  @Input()
  set date(value: Date) {
    if (value && (
      !this._date || (value && this._date.valueOf() !== value.valueOf()))) {
      this._date = new Date(value.valueOf());
      if (this.picker) {
        // if UTC, adjust picker date accordingly
        const pickerDate = this.UTC ? this.pickerUTCOffset(this._date) : this._date;
        this.picker.setDate(pickerDate);
{'fraction_non_alphanumeric': 0.1429164935604487, 'fraction_numerical': 0.0, 'mean_word_length': 3.816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '534353', 'n_tokens_mistral': 790, 'n_tokens_neox': 765, 'n_words': 190}