<commit_before>import { Component } from "@angular/core";
import { IMyDateRange, IMyDateRangeModel, IMyOptions } from "mydaterangepicker";
import { AlertService, AuthenticationService, LoggerService, UserDataService } from "../../services/index";

@Component({
    moduleId: module.id,
    selector: "user-data",
    styleUrls: [ "user-data.component.css" ],
    templateUrl: "user-data.component.html",
})

export class UserDataComponent  {
    protected title: string;
    protected data: Object[];
    protected errorMessage: string;
    protected isAdmin: boolean;

    protected model: IMyDateRange = {
        beginDate: {year: new Date().getFullYear(), month: new Date().getMonth(), day: new Date().getDate()},
        endDate: {year: new Date().getFullYear(), month: new Date().getMonth() + 1, day: new Date().getDate()},
    };
    protected readonly placeholderTxt: string = "Insert timespan";

    constructor(
        private userDataService: UserDataService,
        private alertService: AlertService,
        private loggerService: LoggerService,
        private authenticationService: AuthenticationService,
    ) {
        this.isAdmin = authenticationService.isAdmin();
    }

    // expanding details of a service summary
    protected expand(p: any) {
        p.expanded = !p.expanded;
    }

    // debug only - testing data
    protected test(ip: string, from: string, to: string) {
        console.log("Showing prepared sample");
        this.title = ip;
        this.getData(ip, from, to);
    }

    // prepare information to get data of a specific user
    protected searchUser(/*event: Event*/) {
        //event.preventDefault();

        if (typeof this.model === undefined || !this.model)<commit_msg>date issue fixed<commit_after>import { Component } from "@angular/core";
import { IMyDateRange, IMyDateRangeModel, IMyOptions } from "mydaterangepicker";
import { AlertService, AuthenticationService, LoggerService, UserDataService } from "../../services/index";

@Component({
    moduleId: module.id,
    selector: "user-data",
    styleUrls: [ "user-data.component.css" ],
    templateUrl: "user-data.component.html",
})

export class UserDataComponent  {
    protected title: string;
    protected data: Object[];
    protected errorMessage: string;
    protected isAdmin: boolean;

    protected model: IMyDateRange = {
        beginDate: {year: 0, month: 0, day: 0},
        endDate: {year: new Date().getFullYear(), month: new Date().getMonth() + 1, day: new Date().getDate()},
    };
    protected readonly placeholderTxt: string = "Insert timespan";

    constructor(
        private userDataService: UserDataService,
        private alertService: AlertService,
        private loggerService: LoggerService,
        private authenticationService: AuthenticationService,
    ) {
        this.isAdmin = authenticationService.isAdmin();
        let today = new Date();
        today.setMonth(today.getMonth() - 1);
        this.model.beginDate.year = today.getFullYear();
        this.model.beginDate.month = today.getMonth() + 1;
        this.model.beginDate.day = today.getDate();
    }

    // expanding details of a service summary
    protected expand(p: any) {
        p.expanded = !p.expanded;
    }

    // debug only - testing data
    protected test(ip: string, from: string, to: string) {
        console.log("Showing prepared sample");
        this.title = ip;
        this.getData(ip, from, to);
    }

    // prepare information to get data of a specific user
    protected searchUser(/*event: Event*/) {
        //event.preventDefault();

        if (typeof this.model === undefined || !this.model)
{'fraction_non_alphanumeric': 0.12338908692075679, 'fraction_numerical': 0.0019193857965451055, 'mean_word_length': 3.1034870641169854, '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': '7581878', 'n_tokens_mistral': 1014, 'n_tokens_neox': 998, 'n_words': 279}