-
Notifications
You must be signed in to change notification settings - Fork 0
Date/datetime argument #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
…to date-time-argument
@@ -17,7 +18,8 @@ public final class JsonUtils { | |||
|
|||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to write dates as iso format as it's human readable but timestamps are not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since spectrum picker supports min/max then in the backend we could as well, fine
No description provided.