onBeforeAdd

fires before a new comment is added

void onBeforeAdd(number id,object obj,number index);
idnumberthe ID of the new comment
objobjectthe comment object
indexnumberthe position of the new comment within the comment history

Example

$$("comments").attachEvent("onBeforeAdd",function(id,obj,index){
    // your code here
    const day = obj.date.getDay();
});

See also
Back to top