AtlasOfLivingAustralia / appd-hub

Australian Plant Pest Database Hub
https://appd.ala.org.au
0 stars 2 forks source link

Incorrect year in results list #20

Closed nickdos closed 9 years ago

nickdos commented 9 years ago

Where record date only contains a year or month + year. Shows wrong year (alway 2015).

nickdos commented 9 years ago

Possible fix in AVH code:

if (occurrence.eventDate) {
    outputResultsTd("Date: ", g.formatDate(date: new Date(occurrence.eventDate), format:"dd-MM-yyyy"), true)
} else if (occurrence.occurrenceYear || occurrence.year) {
    outputResultsTd("Year: ", g.formatDate(number:new Date(occurrence.occurrenceYear?:occurrence.year), format:"yyyy"), true)
}

May or may not be same bug...

m-hope commented 9 years ago

Resolved by adding a custom OccurrenceTagLib.groovy file in the appd-hub repository which only displays the occurrence.year if the occurrence.eventdate is not available.