Merged
Conversation
core/src/main/java/com/vml/es/aem/acm/core/code/arg/DateTimeArgument.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/vml/es/aem/acm/core/code/arg/DateTimeArgument.java
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces support for DateTime arguments across both frontend and backend, enhancing the handling of date and time inputs.
- Extended API types to include a new 'DATETIME' argument type and corresponding utility functions.
- Updated the frontend to support DatePicker input via a new branch in the argument component.
- Added a new DateTimeArgument class and updated related backend methods and configurations.
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui.frontend/src/utils/api.types.ts | Extended ArgumentType definition and added DateTimeArgument type and helper functions. |
| ui.frontend/src/components/CodeArgumentInput.tsx | Added support for DateTime argument rendering using DatePicker. |
| core/src/main/java/com/vml/es/aem/acm/core/util/JsonUtils.java | Registered JavaTimeModule for proper date handling. |
| core/src/main/java/com/vml/es/aem/acm/core/code/arg/DateTimeArgument.java | New DateTimeArgument class implementation for handling datetime values. |
| core/src/main/java/com/vml/es/aem/acm/core/code/Arguments.java | Added methods for creating DateTimeArgument instances. |
| core/src/main/java/com/vml/es/aem/acm/core/code/ArgumentType.java | Updated enum to include a DATETIME type. |
Files not reviewed (2)
- core/pom.xml: Language not supported
- pom.xml: Language not supported
Comments suppressed due to low confidence (1)
core/src/main/java/com/vml/es/aem/acm/core/code/arg/DateTimeArgument.java:78
- The error message in the Variant.of method references 'Bool argument' - it should be updated to correctly reference a DateTime argument.
orElseThrow(() -> new IllegalArgumentException(String.format("Bool argument cannot be displayed as '%s'!", name)));
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…to date-time-argument
| public static final ObjectMapper MAPPER = new ObjectMapper() | ||
| .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false) | ||
| .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); | ||
| .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) |
Collaborator
There was a problem hiding this comment.
I prefer to write dates as iso format as it's human readable but timestamps are not
Collaborator
Author
There was a problem hiding this comment.
I see only two options in this configuration: timestamps or with zone id. Should I change it?
| render={({ field, fieldState }) => ( | ||
| <View key={arg.name} marginBottom="size-200"> | ||
| <DatePicker | ||
| {...field} |
Collaborator
There was a problem hiding this comment.
Since spectrum picker supports min/max then in the backend we could as well, fine
core/src/main/java/com/vml/es/aem/acm/core/code/arg/DateTimeArgument.java
Outdated
Show resolved
Hide resolved
krystian-panek-vmltech
approved these changes
Apr 28, 2025
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.
No description provided.