<commit_before>import {
  Input,
  Output,
  Component,
  ElementRef,
  ViewEncapsulation,
  ChangeDetectorRef,
  EventEmitter,
  ViewChild
} from '@angular/core';
import { NguiDatetime } from './datetime';

declare var moment: any;

//@TODO
// . display currently selected day

/**
 * show a selected date in monthly calendar
 */
@Component({
  providers: [NguiDatetime],
  selector: 'ngui-datetime-picker',
  template: `
  <div class="closing-layer" (click)="close()" *ngIf="showCloseLayer" ></div>
  <div class="ngui-datetime-picker">
    <div class="close-button" *ngIf="showCloseButton" (click)="close()"></div>
    
    <!-- Month - Year  -->
    <div class="month" *ngIf="!timeOnly">
      <b class="prev_next prev year" (click)="updateMonthData(-12)">&laquo;</b>
      <b class="prev_next prev month" (click)="updateMonthData(-1)">&lsaquo;</b>
       <span title="{{monthData?.fullName}}">
         {{monthData?.shortName}}
       </span>
       <span (click)="showYearSelector = true">
        {{monthData.year}}
       </span>
      <b class="prev_next next year" (click)="updateMonthData(+12)">&raquo;</b>
      <b class="prev_next next month" (click)="updateMonthData(+1)">&rsaquo;</b>
    </div>

    <!-- Week number / Days  -->
    <div class="week-numbers-and-days"
      [ngClass]="{'show-week-numbers': !timeOnly && showWeekNumbers}">
      <!-- Week -->
      <div class="week-numbers" *ngIf="!timeOnly && showWeekNumbers">
        <div class="week-number" *ngFor="let weekNumber of monthData.weekNumbers">
          {{weekNumber}}
        </div>
      </div>
      
      <!-- Date -->
      <div class="days" *ngIf="!timeOnly">

        <!-- Su Mo Tu We Th Fr Sa -->
        <div class="day-of-week"
             *ngFor="let dayOfWeek of monthData.localizedDaysOfWeek; let ndx=index"
             [class.weekend]="isWeekend(ndx + monthData.firstDayOfWeek)"
             title="{{dayOfWeek.fullName}}">
          {{dayOfWeek.shortName}}
        </div>

        <!-- Fill up blank days for this month -->
        <div *ngIf="monthData.leadingDays.length < 7">
          <div class="day"
              (click)="updateMonthData(-1)"
               *ngFor="let dayNum of monthData.leadingDays">
            {{dayNum}}
          </div>
        </div>

        <div class="day"
             *ngFor="let dayNum of monthData.days"
             (click)="selectDateTime(toDate(dayNum))"
             title="{{monthData.year}}-{{monthData.month+1}}-{{dayNum}}"
             [ngClass]="{
               selectable: !isDateDisabled(toDate(dayNum)),
               selected: toDate(dayNum).getTime() === toDateOnly(selectedDate).getTime(),
               today: toDate(dayNum).getTime() === today.getTime(),
               weekend: isWeekend(dayNum, monthData.month)
             }">
          {{dayNum}}
        </div>

        <!-- Fill up blank days for this month -->
        <div *ngIf="monthData.trailingDays.length < 7">
          <div class="day"
               (click)="updateMonthData(+1)"
               *ngFor="let dayNum of monthData.trailingDays">
            {{dayNum}}
          </div>
        </div>
      </div>
    </div>

    <div class="shortcuts" *ngIf="showTodayShortcut">
      <a href="#" (click)="selectToday()">Today</a><commit_msg>The Today shortcut was broken because of a stray href. Now fixed<commit_after>import {
  Input,
  Output,
  Component,
  ElementRef,
  ViewEncapsulation,
  ChangeDetectorRef,
  EventEmitter,
  ViewChild
} from '@angular/core';
import { NguiDatetime } from './datetime';

declare var moment: any;

//@TODO
// . display currently selected day

/**
 * show a selected date in monthly calendar
 */
@Component({
  providers: [NguiDatetime],
  selector: 'ngui-datetime-picker',
  template: `
  <div class="closing-layer" (click)="close()" *ngIf="showCloseLayer" ></div>
  <div class="ngui-datetime-picker">
    <div class="close-button" *ngIf="showCloseButton" (click)="close()"></div>
    
    <!-- Month - Year  -->
    <div class="month" *ngIf="!timeOnly">
      <b class="prev_next prev year" (click)="updateMonthData(-12)">&laquo;</b>
      <b class="prev_next prev month" (click)="updateMonthData(-1)">&lsaquo;</b>
       <span title="{{monthData?.fullName}}">
         {{monthData?.shortName}}
       </span>
       <span (click)="showYearSelector = true">
        {{monthData.year}}
       </span>
      <b class="prev_next next year" (click)="updateMonthData(+12)">&raquo;</b>
      <b class="prev_next next month" (click)="updateMonthData(+1)">&rsaquo;</b>
    </div>

    <!-- Week number / Days  -->
    <div class="week-numbers-and-days"
      [ngClass]="{'show-week-numbers': !timeOnly && showWeekNumbers}">
      <!-- Week -->
      <div class="week-numbers" *ngIf="!timeOnly && showWeekNumbers">
        <div class="week-number" *ngFor="let weekNumber of monthData.weekNumbers">
          {{weekNumber}}
        </div>
      </div>
      
      <!-- Date -->
      <div class="days" *ngIf="!timeOnly">

        <!-- Su Mo Tu We Th Fr Sa -->
        <div class="day-of-week"
             *ngFor="let dayOfWeek of monthData.localizedDaysOfWeek; let ndx=index"
             [class.weekend]="isWeekend(ndx + monthData.firstDayOfWeek)"
             title="{{dayOfWeek.fullName}}">
          {{dayOfWeek.shortName}}
        </div>

        <!-- Fill up blank days for this month -->
        <div *ngIf="monthData.leadingDays.length < 7">
          <div class="day"
              (click)="updateMonthData(-1)"
               *ngFor="let dayNum of monthData.leadingDays">
            {{dayNum}}
          </div>
        </div>

        <div class="day"
             *ngFor="let dayNum of monthData.days"
             (click)="selectDateTime(toDate(dayNum))"
             title="{{monthData.year}}-{{monthData.month+1}}-{{dayNum}}"
             [ngClass]="{
               selectable: !isDateDisabled(toDate(dayNum)),
               selected: toDate(dayNum).getTime() === toDateOnly(selectedDate).getTime(),
               today: toDate(dayNum).getTime() === today.getTime(),
               weekend: isWeekend(dayNum, monthData.month)
             }">
          {{dayNum}}
        </div>

        <!-- Fill up blank days for this month -->
        <div *ngIf="monthData.trailingDays.length < 7">
          <div class="day"
               (click)="updateMonthData(+1)"
               *ngFor="let dayNum of monthData.trailingDays">
            {{dayNum}}
          </div>
        </div>
      </div>
    </div>

    <div class="shortcuts" *ngIf="showTodayShortcut">
      <a (click)="selectToday()">Today</a>
{'fraction_non_alphanumeric': 0.17513694461351187, 'fraction_numerical': 0.0033475349969567863, 'mean_word_length': 2.412772585669782, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 101, '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': '6938254', 'n_tokens_mistral': 2103, 'n_tokens_neox': 2028, 'n_words': 407}