Skip to content

Commit e8dc555

Browse files
ivicacclaude
andcommitted
4634 Stop mutating shared DATE_FORMAT_PROPERTY in ConvertToDate action
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2977e62 commit e8dc555

2 files changed

Lines changed: 42 additions & 11 deletions

File tree

server/libs/modules/components/date-helper/src/main/java/com/bytechef/component/date/helper/action/DateHelperConvertToDateAction.java

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package com.bytechef.component.date.helper.action;
1818

1919
import static com.bytechef.component.date.helper.constants.DateHelperConstants.DATE_FORMAT;
20-
import static com.bytechef.component.date.helper.constants.DateHelperConstants.DATE_FORMAT_PROPERTY;
2120
import static com.bytechef.component.date.helper.constants.DateHelperConstants.DATE_STRING;
21+
import static com.bytechef.component.date.helper.constants.DateHelperConstants.UNIX_TIMESTAMP;
2222
import static com.bytechef.component.definition.ComponentDsl.action;
2323
import static com.bytechef.component.definition.ComponentDsl.dateTime;
2424
import static com.bytechef.component.definition.ComponentDsl.option;
@@ -56,8 +56,39 @@ public class DateHelperConvertToDateAction {
5656
option("Standard", "standard"),
5757
option("Custom", "custom"))
5858
.required(true),
59-
DATE_FORMAT_PROPERTY
60-
.displayCondition("dateFormatType == 'standard'"),
59+
string(DATE_FORMAT)
60+
.label("Date Format")
61+
.description("Here's what each part of the format (eg. YYYY) means: " +
62+
"yyyy : Year (4 digits) " +
63+
"yy : Year (2 digits) " +
64+
"MMMM : Month (full name) " +
65+
"MMM : Month (short name) " +
66+
"MM : Month (2 digits) " +
67+
"EEE : Day (short name) " +
68+
"dd : Day (2 digits) " +
69+
"HH : Hour (2 digits) " +
70+
"mm : Minute (2 digits) " +
71+
"ss : Second (2 digits).")
72+
.options(
73+
option("EEE MMM dd yyyy HH:mm:ss", "EEE MMM dd yyyy HH:mm:ss", "Sun Sep 17 2023 11:23:58"),
74+
option("EEE MMM dd HH:mm:ss yyyy", "EEE MMM dd HH:mm:ss yyyy", "Sun Sep 17 11:23:58 2023"),
75+
option("MMMM dd yyyy HH:mm:ss", "MMMM dd yyyy HH:mm:ss", "September 17 2023 11:23:58"),
76+
option("MMMM dd yyyy", "MMMM dd yyyy", "September 17 2023"),
77+
option("MMM dd yyyy", "MMM dd yyyy", "Sep 17 2023"),
78+
option("yyyy-MM-ddTHH:mm:ss", "yyyy-MM-dd'T'HH:mm:ss", "2023-09-17T11:23:58"),
79+
option("yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss", "2023-09-17 11:23:58"),
80+
option("yyyy-MM-dd", "yyyy-MM-dd", "2023-09-17"),
81+
option("MM-dd-yyyy", "MM-dd-yyyy", "09-17-2023"),
82+
option("MM/dd/yyyy", "MM/dd/yyyy", "09/17/2023"),
83+
option("MM/dd/yy", "MM/dd/yy", "09/17/23"),
84+
option("dd-MM-yyyy", "dd-MM-yyyy", "17-09-2023"),
85+
option("dd/MM/yyyy", "dd/MM/yyyy", "17/09/2023"),
86+
option("dd.MM.yyyy", "dd.MM.yyyy", "17.09.2023"),
87+
option("dd/MM/yy", "dd/MM/yy", "17/09/23"),
88+
option("dd.MM.yy", "dd.MM.yy", "17.09.23"),
89+
option("Time in unix format", UNIX_TIMESTAMP, "1694949838"))
90+
.displayCondition("dateFormatType == 'standard'")
91+
.required(true),
6192
string(DATE_FORMAT)
6293
.label("Date Format")
6394
.description(

server/libs/modules/components/date-helper/src/test/resources/definition/date-helper_v1.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"controlType": "SELECT",
8989
"defaultValue": null,
9090
"description": "Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits).",
91-
"displayCondition": "dateFormatType == 'standard'",
91+
"displayCondition": null,
9292
"exampleValue": null,
9393
"expressionEnabled": null,
9494
"hidden": null,
@@ -1537,7 +1537,7 @@
15371537
"controlType": "SELECT",
15381538
"defaultValue": null,
15391539
"description": "Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits).",
1540-
"displayCondition": "dateFormatType == 'standard'",
1540+
"displayCondition": null,
15411541
"exampleValue": null,
15421542
"expressionEnabled": null,
15431543
"hidden": null,
@@ -1721,7 +1721,7 @@
17211721
"controlType": "SELECT",
17221722
"defaultValue": null,
17231723
"description": "Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits).",
1724-
"displayCondition": "dateFormatType == 'standard'",
1724+
"displayCondition": null,
17251725
"exampleValue": null,
17261726
"expressionEnabled": null,
17271727
"hidden": null,
@@ -3282,7 +3282,7 @@
32823282
"controlType": "SELECT",
32833283
"defaultValue": null,
32843284
"description": "Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits).",
3285-
"displayCondition": "dateFormatType == 'standard'",
3285+
"displayCondition": null,
32863286
"exampleValue": null,
32873287
"expressionEnabled": null,
32883288
"hidden": null,
@@ -3565,7 +3565,7 @@
35653565
"controlType": "SELECT",
35663566
"defaultValue": null,
35673567
"description": "Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits).",
3568-
"displayCondition": "dateFormatType == 'standard'",
3568+
"displayCondition": null,
35693569
"exampleValue": null,
35703570
"expressionEnabled": null,
35713571
"hidden": null,
@@ -4990,7 +4990,7 @@
49904990
"controlType": "SELECT",
49914991
"defaultValue": null,
49924992
"description": "Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits).",
4993-
"displayCondition": "dateFormatType == 'standard'",
4993+
"displayCondition": null,
49944994
"exampleValue": null,
49954995
"expressionEnabled": null,
49964996
"hidden": null,
@@ -5171,7 +5171,7 @@
51715171
"controlType": "SELECT",
51725172
"defaultValue": null,
51735173
"description": "Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits).",
5174-
"displayCondition": "dateFormatType == 'standard'",
5174+
"displayCondition": null,
51755175
"exampleValue": null,
51765176
"expressionEnabled": null,
51775177
"hidden": null,
@@ -6705,7 +6705,7 @@
67056705
"controlType": "SELECT",
67066706
"defaultValue": null,
67076707
"description": "Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits).",
6708-
"displayCondition": "dateFormatType == 'standard'",
6708+
"displayCondition": null,
67096709
"exampleValue": null,
67106710
"expressionEnabled": null,
67116711
"hidden": null,

0 commit comments

Comments
 (0)