export class CHour
{
    public minutes_sum: number;
    private _hours: number;
    private _minutes: number;

    constructor(secs: number)
    {
        this.minutes_sum = Math.round(secs / 60);
        this._hours = Math.floor(this.minutes_sum / 60);
        this._minutes = this.minutes_sum % 60;
    }

    Add(hour: CHour)
    {
        this.minutes_sum += hour.minutes_sum;
        this._hours = Math.floor(this.minutes_sum / 60);
        this._minutes = this.minutes_sum % 60;
    }

    Print()
    {
        // const nbspc = String.fromCharCode(160);
        // return (nbspc + nbspc + nbspc + this._hours).slice(-4) + ":" + ("0" + this._minutes).slice(-2);
        return this._hours + ":" + 
        ("0" + this._minutes).slice(-2);
    }
};
