- If I create the new annotation with no modDate and try to set it later, it just overwrites the .name with the date and doesn't set the modDate.
- If I create it with both the modDate and name, it sets the name to the modDate.
- If I create it with only the name, and then try to set the modDate, it will overwrite the name with the date, and not set the modDate
To reproduce, run in the console:
Code: Select all
{
let partyDate = new Date('1999-12-31T12:00:00');
let partyAnn = this.addAnnot({
// name won't stick if either date set
name: 'Prince',
type: 'FreeText',
page: this.pageNum,
richContents: [{text:'PARTY!', textColor:["RGB",0.5,0,1], textSize: 20}],
rect: [100,50,180,70],
width:0,
// can set creationDate on new annotation
creationDate: partyDate,
modDate: partyDate,
});
// get name, modification date but Prince is not here
console.println('Name: '+partyAnn.name);
console.println('Date: '+partyAnn.modDate);
console.println('Since: '+partyAnn.creationDate);
}