geonetwork / geonetwork/core-geonetwork
4.2.x: Creation and Revision Dates display incorrectly in default view
- Dominant language
- Java
- Stars
- 521
- Forks
- 515
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
If a creation or revision date is set to year or year and month, then in default display view (and the elasticsearch index) it is displayed as DD-MM-YYYY (and set to the first of the year or the first of the month respectively). This is really confusing because in advanced display view the correct form of the date is shown.
**To Reproduce**
Steps to reproduce the behavior:
1. Load a sample record for ISO19139 into a clean Geonetwork
2. Edit it and set the creation date for the record to "year only" and pick a year
3. Save and close the record
4. View the default view and see that the creation date is set to 01-01-year
**Expected behavior**
The displayed creation or revision date should respect the format saved in the metadata record, as it is with the temporal extent and in the advanced display view
**Screenshots**
Edit view

Default display view

Contributor guide
Research direction
Reproduce the issue with an ISO19139 sample record in a clean GeoNetwork, setting creation or revision dates to year-only and year-and-month precision. Compare the default display, advanced display, temporal extent, and Elasticsearch index; done means each preserves the precision saved in the metadata instead of showing an inferred day or month.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, java
- Domain
- frontend, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100