Handle all supported date value types in date picker#5345
Merged
Conversation
GauravD2t
approved these changes
May 18, 2026
Contributor
|
Hello @oscar-escire, thanks for your contribution. The datetime picker works perfectly on my end, and all test cases passed.
|
nathanmlf
approved these changes
May 18, 2026
nathanmlf
left a comment
There was a problem hiding this comment.
Hey @oscar-escire! I tested it on my side and it works as expected. Nice job!
tdonohue
approved these changes
May 22, 2026
Member
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @oscar-escire ! This looks good to me. The changes are minor overall, and I verified the date field still works the same as before. Not seeing any newly introduced issues
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-9_x
git worktree add -d .worktree/backport-5345-to-dspace-9_x origin/dspace-9_x
cd .worktree/backport-5345-to-dspace-9_x
git switch --create backport-5345-to-dspace-9_x
git cherry-pick -x 639e647d3b992ef8975418943ca17e2de34c3a09 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

References
Description
Replace unsafe .toString() calls on date model values with a new dateValueToString() utility that properly handles all supported types (string, Date, NgbDateStruct) and throws an informative error for unsupported object types.
Instructions for Reviewers
npm test -- --include="src/app/utils/date.util.spec.ts"— all 32 tests should passnpm test -- --include="src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts"— all 17 tests should passnpm test -- --include="src/app/shared/form/builder/parsers/date-field-parser.spec.ts"— all 3 tests should passList of changes in this PR:
dateValueToString()utility function insrc/app/utils/date.util.tsthat safely convertsstring | Date | objectvalues toYYYY-MM-DDformatted stringsdate-picker.component.tsto usedateValueToString()instead of.toString(), removing theeslint-disablecomment andtododate-field-parser.tsto usedateValueToString()instead of.toString(), removing theeslint-disablecomment andtododateValueToString()indate.util.spec.ts(string, Date, NgbDateStruct, arbitrary object, empty object)date-picker.component.spec.tsto verify initialization fromDateandNgbDateStruct-like objectsChecklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.