Skip to content

Separate date and datetime options in date picker control#9153

Merged
PascalLike merged 4 commits intogeonetwork:mainfrom
GeoCat:date-picker
Feb 11, 2026
Merged

Separate date and datetime options in date picker control#9153
PascalLike merged 4 commits intogeonetwork:mainfrom
GeoCat:date-picker

Conversation

@GeoSander
Copy link
Collaborator

@GeoSander GeoSander commented Jan 30, 2026

Description

This PR breaks the "Date or date time" option in the DatePickerDirective.js into 2 separate options:

  • Date (only)
  • Date and time
image image

Date (only) will be the default option when creating new records.
For existing records, if there's a time component (and hideTimeInCalendar is not set), it will show date and time first.

Furthermore, the directive has been cleaned up and refactored a bit, and the CSS simplified (using flex). The HTML dropdown contains an additional option (if hideTimeInCalendar is falsy) and 2 new translation keys (dateOnlyMode and dateTimeMode) so there will not be any conflicts with the old dropdown translations for older versions.
The calendar icon for the mode selector was changed to a cog icon to make clear that it's a config option and to make sure that it cannot be confused for the other calendar icon in the date field.

Please read issue #9152 for more context.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using [automatic tests](https://github.com/geonetwork/core-geonetwork/blob/main/software_development/TESTING.md)
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@GeoSander GeoSander changed the title Split datetime option, cleanup datepicker control [#9152] Separate date and datetime options in date picker control [#9152] Feb 2, 2026
@GeoSander GeoSander changed the title Separate date and datetime options in date picker control [#9152] Separate date and datetime options in date picker control Feb 2, 2026
@GeoSander GeoSander added this to the 4.4.10 milestone Feb 2, 2026
@GeoSander GeoSander marked this pull request as ready for review February 2, 2026 09:28
Copy link
Member

@josegar74 josegar74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GeoSander I have done this test:

  1. Create a new ISO19139 metadata, and set a date.

  2. Save the metadata --> the form shows the date properly

  3. Change to datetime and set the time.

  4. Save the metadata --> the form shows the datetime properly

  5. Change to date and save the metadata --> the form shows the datetime instead of the date

@GeoSander
Copy link
Collaborator Author

GeoSander commented Feb 3, 2026

Thanks for the review @josegar74, I fixed ES5 compatibility (and adjusted my IDE to skip ES6 inspections).
I will also do some more tests now switching between modes and saving the metadata, to see if I can make that more robust.

@GeoSander GeoSander removed the request for review from PascalLike February 4, 2026 08:58
@GeoSander
Copy link
Collaborator Author

@tylerjmchugh Are you able to have a look at this?

Copy link
Member

@josegar74 josegar74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @GeoSander, the issue described is fixed and looks working well.

Nice improvements have also been made to the code, including for managing time zones.

Copy link
Contributor

@tylerjmchugh tylerjmchugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works as expected.

  • Time is hidden by default with the option of adding a time (unless hideTimeInCalendar)
  • Time is shown if the existing data includes a time.

@GeoSander GeoSander removed the request for review from ianwallen February 11, 2026 08:09
@PascalLike PascalLike merged commit 44a4ffe into geonetwork:main Feb 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments