Detailed description of issue
When an annotation gets added, its initial comment in the notes panel has the original date/time in which the annotation was added. When new comments are added to the annotation though, the original/first comment’s date always updates to the latest comment’s date. Is there a way to keep the original date of the first comment of annotations?
Does your issue happen with every document, or just one?
Happens with every document/annotation.
You can change the appearance of the notes individually by using the dangerouslySetNoteTransformFunction API Please read about the documentation for that to see if it is the right choice for you. Here is a small snippet to show how you could do that:
You still may need to parse the date your liking as we DayJs in our UI code.
Alternatively, if this solution does not work for you, you could fork our open source UI you can find a guide how to that here. Here you’ll want to edit this line to be the date of the first date created rather than the latestActivityDate.
Thanks for the help. This would work perfectly, but wrapper.id seems to always be an empty string, so it doesn’t work. Is this a bug on the definition of dangerouslySetNoteTransformFunction?
I looked at every member and method of wrapper but I can’t find another way to get the annotation it wraps from it. This would work if I could grab the annotation from the wrapper somehow.
(I couldn’t find a way to make this work with getAnnotationsList() either).
It looks like that we added the note id to the wrapper in a later version of PDF.js Express, it looks like my original approach will work in the current version - 7.3.7. However, after looking more at the problem, I may have given you an unnecessarily over-complicated solution, I believe this code snippet should work in older versions: