table :task_time_worked

when :before insert/update

Script:

var additionalComments = '';
var workNotes = '';
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;

if(current.task.comments.changes()){
additionalComments = current.task.comments.getJournalEntry(1);

}else if(current.task.work_notes.changes()){
workNotes = current.task.work_notes.getJournalEntry(1);

}else{
//Do nothing

}

if(additionalComments != ''){
current.comments = additionalComments.replace(dateRE, '');
}

if(workNotes != ''){
current.comments = workNotes.replace(dateRE, '');
}