Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

kamil-orwat-vmltech
Copy link
Collaborator

No description provided.

@kamil-orwat-vmltech kamil-orwat-vmltech marked this pull request as ready for review April 18, 2025 07:36
Copy link

@Copilot Copilot AI left a 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)));

@@ -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)
Copy link
Collaborator

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

Copy link
Collaborator Author

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}
Copy link
Collaborator

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

@kamil-orwat-vmltech kamil-orwat-vmltech changed the title Work in progress Date/datetime argument Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants