Adding date metadata fields that have the same behavior as accessDate

I am working on a plugin that extends Zotero to add some custom metadata fields needed for our purposes. I'm doing this by adding values to the tables customItemTypes, customFields, customItemTypeFields, etc.

I need to add a few date fields and would like them to have the same behavior as accessDate (namely, when you enter a date, it is formatted, and when you do not enter a date, it is removed). Is there any way to do this besides modifying the method createValueElement in itembox.xml (adding my new fields to the case statement at line 1245)?
  • No. Those tables aren't yet meant for outside use, which is why it's not yet possible to specify things like date formatting in the custom field definitions.
  • edited March 16, 2010
    Fields defined there also will cause sync errors if you try to sync them to the server.
  • Thanks for the reply.

    One more question: at this point, is it better to put in new metadata fields in the "custom..." tables or in the system tables (fields, itemTypes, itemTypeFields, ...)? Assuming one option is better than the other.
    I realize this will cause sync errors. That is not an issue for me as users won't be able to sync to the server.
  • You definitely shouldn't touch the main tables. The custom tables should theoretically work—they're just limited and at this point we can't guarantee there won't be breakage. But if you edit the main tables the breakage would be pretty much guaranteed.
Sign In or Register to comment.