Repository: kestra-io/kestra (java)

Issue:
JSON Schema validation refuse time without timezone — "String is not a RFC3339 time" warning
### Describe the issue

Our JSON Schema refuse time without timezone but they are correctly accepted by our serialization framework (using the default timezone).

Using one will show the following warning: 
![image](https://github.com/user-attachments/assets/0084c04b-5dc4-47a8-8a19-6aa48f032cc6)

But the RFC in question allows 'partial time' without timezone so we should change the  JSON shema (or the editor side) to allow such time.

### Environment

- Kestra Version: 0.20.0-SNAPSHOT
- Operating System (OS/Docker/Kubernetes):
- Java Version (if you don't run kestra in Docker):


Pull request description:
fix(core): local time format
Fixes #5734

Patch:
diff --git a/core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java b/core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java
index 58801a563..461a52441 100644
--- a/core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java
+++ b/core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java
@@ -40,6 +40,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.time.Duration;
+import java.time.LocalTime;
 import java.util.*;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
@@ -205,7 +206,11 @@ public class JsonSchemaGenerator {
                         ObjectNode definitionReference = context
                             .createDefinitionReference(context.getTypeContext().resolve(String.class))
                             .put("format", "duration");
-
+                        return new CustomDefinition(definitionReference, true);
+                    } else if (javaType.isInstanceOf(LocalTime.class)) {
+                        ObjectNode definitionReference = context
+                            .createDefinitionReference(context.getTypeContext().resolve(String.class))
+                            .put("format", "partial-time"); // we change the default 'time' format for 'partial-time' as Monaco Editor mandates an offset or a timezone for 'time' format
                         return new CustomDefinition(definitionReference, true);
                     } else {
                         return null;
diff --git a/core/src/main/java/io/kestra/core/services/FlowTriggerService.java b/core/src/main/java/io/kestra/core/services/FlowTriggerService.java
index 3b77f50a4..5f3dac9af 100644
--- a/core/src/main/java/io/kestra/core/services/FlowTriggerService.java
+++ b/core/src/main/java/io/kestra/core/services/FlowTriggerService.java
@@ -16,6 +16,7 @@ import lombok.AllArgsConstructor;
 import lombok.Getter;
 import lombok.ToString;
 
+import java.time.ZonedDateTime;
 import java.util.*;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
@@ -87,7 +88,10 @@ public class FlowTriggerService {
                                 multipleCondition
                             )
                         )
-                ).toList();
+                )
+                // avoid evaluating expired windows (for ex for daily time window or deadline)
+                .filter(flowWithFlowTriggerAndMultipleCondition -> flowWithFlowTriggerAndMultipleCondition.getMultipleConditionWindow().isValid(ZonedDateTime.now()))
+                .toList();
 
             // evaluate multiple conditions
             multipleConditionWindowsByFlow = flowWithMultipleConditionsToEvaluate.stream().map(f -> {


Test patch:
diff --git a/core/src/test/java/io/kestra/core/models/triggers/multipleflows/AbstractMultipleConditionStorageTest.java b/core/src/test/java/io/kestra/core/models/triggers/multipleflows/AbstractMultipleConditionStorageTest.java
index 38e216ace..360b28456 100644
--- a/core/src/test/java/io/kestra/core/models/triggers/multipleflows/AbstractMultipleConditionStorageTest.java
+++ b/core/src/test/java/io/kestra/core/models/triggers/multipleflows/AbstractMultipleConditionStorageTest.java
@@ -182,6 +182,23 @@ public abstract class AbstractMultipleConditionStorageTest {
         assertThat(expired.size(), is(1));
     }
 
+    @Test
+    void dailyTimeDeadline_Expired() throws Exception {
+        MultipleConditionStorageInterface multipleConditionStorage = multipleConditionStorage();
+
+        Pair<Flow, MultipleCondition> pair = mockFlow(TimeWindow.builder().type(Type.DAILY_TIME_DEADLINE).deadline(OffsetTime.now().minusSeconds(1)).build());
+
+        MultipleConditionWindow window = multipleConditionStorage.getOrCreate(pair.getKey(), pair.getRight());
+        this.save(multipleConditionStorage, pair.getLeft(), Collections.singletonList(window.with(ImmutableMap.of("a", true))));
+        assertThat(window.getFlowId(), is(pair.getLeft().getId()));
+        window = multipleConditionStorage.getOrCreate(pair.getKey(), pair.getRight());
+
+        assertThat(window.getResults(), anEmptyMap());
+
+        List<MultipleConditionWindow> expired = multipleConditionStorage.expired(null);
+        assertThat(expired.size(), is(1));
+    }
+
     @Test
     void dailyTimeWindow() throws Exception {
         MultipleConditionStorageInterface multipleConditionStorage = multipleConditionStorage();