<commit_before>class TaCounterSetTime extends React.Component{
    constructor(props){
        super(props);
    }
    handleClick(){
        this.props.click(null);
    }
    render(){
        return (<button key={"TaCounterSetTimeNow"+this.props.cid.toString()} onClick={()=>{this.handleClick();}}>{this.props.label}</button>);
    }
}
class TaCounter extends pso2tools_module{
    constructor(app){
        super(app);
        this.db = app.db;
    }

    dbInitialize(){
        this.db.run("ALTER TABLE `characters` ADD COLUMN `lastTATime` TIMESTAMP NULL");
    }

    getTATime(cid){
        return this.db.run("SELECT lastTATime FROM characters WHERE cid = ?", [Math.floor(cid)])[0].lastTATime;
    }
    setTATTime(cid, time = null){
        if(time == null){
            time = Date.now();
        }
        this.db.run("UPDATE characters SET lastTATime=? WHERE cid=?",[time, cid]);
        this.app.render();
    }
    renderToolBlock(cid){
        var lastTaTime = this.getTATime(cid);
        var cdComplete = Date.now() > (lastTaTime+ (1000*3600*166))
        return (<div>{"Previous TA Time: "+(new Date(lastTaTime)).toLocaleString()}<br/>
        <span style={{color: cdComplete?"green":"red"}}>{"Cool Down Complete time: "+(new Date(lastTaTime+ (1000*3600*166))).toLocaleString()}</span><br />
        <TaCounterSetTime cid={cid} time={"now"} label={"Just done TA"} click={(time)=>{this.setTATTime(cid,time)}}/>
        </div>);
    }

    renderCharTable(cid){
        return <td key={"tbltaCounter"+cid.toString()}>{(Date.now() > (this.getTATime(cid)+1000*3600*166))?(<span style={{color:"green"}}>{"TA mission available"}</span>):(<span style={{color:"red"}}>{"TA mission unavailable"}</span>)}</td>;
    }
}<commit_msg>modify to true unix time stamp, instead of Chrome's timestamp (in ms)<commit_after>class TaCounterSetTime extends React.Component{
    constructor(props){
        super(props);
    }
    handleClick(){
        this.props.click(null);
    }
    render(){
        return (<button key={"TaCounterSetTimeNow"+this.props.cid.toString()} onClick={()=>{this.handleClick();}}>{this.props.label}</button>);
    }
}
class TaCounter extends pso2tools_module{
    constructor(app){
        super(app);
        this.db = app.db;
    }

    dbInitialize(){
        this.db.run("ALTER TABLE `characters` ADD COLUMN `lastTATime` TIMESTAMP NULL");
    }

    getTATime(cid){
        return this.db.run("SELECT lastTATime FROM characters WHERE cid = ?", [Math.floor(cid)])[0].lastTATime;
    }
    setTATTime(cid, time = null){
        if(time == null){
            time = Date.now() / 1000;
        }
        this.db.run("UPDATE characters SET lastTATime=? WHERE cid=?",[time, cid]);
        this.app.render();
    }
    renderToolBlock(cid){
        var lastTaTime = this.getTATime(cid);
        var cdComplete = Date.now() > (lastTaTime+ (3600*166))*1000
        return (<div>{"Previous TA Time: "+(new Date(lastTaTime*1000)).toLocaleString()}<br/>
        <span style={{color: cdComplete?"green":"red"}}>{"Cool Down Complete time: "+(new Date(lastTaTime*1000+ (1000*3600*166))).toLocaleString()}</span><br />
        <TaCounterSetTime cid={cid} time={"now"} label={"Just done TA"} click={(time)=>{this.setTATTime(cid,time)}}/>
        </div>);
    }

    renderCharTable(cid){
        return <td key={"tbltaCounter"+cid.toString()}>{(Date.now() > (this.getTATime(cid)*1000+1000*3600*166))?(<span style={{color:"green"}}>{"TA mission available"}</span>):(<span style={{color:"red"}}>{"TA mission unavailable"}</span>)}</td>;
    }
}
{'fraction_non_alphanumeric': 0.19122609673790777, 'fraction_numerical': 0.024184476940382452, 'mean_word_length': 3.4854981084489283, 'pattern_counts': {'":': 2, '<': 33, '<?xml version=': 0, '>': 41, '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': '1522431', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1191, 'n_words': 206}