silentdot / zotero-markdown-translator

A simple Zotero translator that creates a Markdown Link when exporting
93 stars 4 forks source link

NaN for year of the publication #1

Closed danieltomasz closed 3 years ago

danieltomasz commented 3 years ago

Sometimes when I use the translator I was getting NaN for the year, even if the year is present in the metadata, for example: Kosciessa. NaN. Standard multiscale entropy reflects neural dynamics at mismatched temporal scales: What’s signal irregularity got to do with it?

Now I replaced it with the latest translator from github and I am getting also day date Kosciessa. 11-May-2020. Standard multiscale entropy reflects neural dynamics at mismatched temporal scales: What’s signal irregularity got to do with it?

silentdot commented 3 years ago

Hey,

this was a known challenge. Not every Metadata has the same date format, so in the latest release it will try to convert the date field into a JavaScript Date Object. If this fails, it just directly uses the value from the date field.

So in your case, "11-May-2020" isn't convertible into a Date Object so it just uses the value from the metadata.

The reason could be that in your date, numbers and words are mixed. So try to change to value to something like "11-05-2020". That should make it work.

Let me know if that has helped you. :)

silentdot commented 3 years ago

OK, I think I have fixed the issue, and tested with "11-May-2020".

Get the newest Version and tell me if the problem still occurs.

danieltomasz commented 3 years ago

Thanks, I will today test that!

danieltomasz commented 3 years ago

It works! Thanks! I am closing this issue for now!