geonetwork / geonetwork/core-geonetwork

4.2.x: Creation and Revision Dates display incorrectly in default view

Open
#6,876 0 comments 0 reactions 0 assignees View on GitHub
bug
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
![Screenshot from 2023-03-01 18-40-10](https://user-images.githubusercontent.com/1544849/222234528-2f4ca941-4c58-4583-a277-335e97a941ab.png)

Default display view
![Screenshot from 2023-03-01 18-40-28](https://user-images.githubusercontent.com/1544849/222234651-60230030-24b4-4725-8bbe-706ec17ea604.png)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.