fix: handle all supported date value types in date picker (#2956)#5163
Closed
JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
Closed
fix: handle all supported date value types in date picker (#2956)#5163JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
Conversation
Contributor
|
|
tdonohue
requested changes
Mar 30, 2026
Member
tdonohue
left a comment
There was a problem hiding this comment.
@JorgeEscire and @guillermo-escire : This PR is also affected by the malicious bot. This must be cleaned up before it will be reviewed.
Member
|
Closing, as this PR is impacted by PolinRider malware. @JorgeEscire and @oscar-escire : We can reopen this PR once it is cleaned up. |
12 tasks
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 newdateValueToString()utility that properly handles all supported types (string,Date,NgbDateStruct) and throws an informative error for unsupported object types.Instructions for Reviewers
List 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 objectsHow to test:
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 passChecklist
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.