Skip to content

Commit 787701d

Browse files
committed
dropDown added
1 parent 7a26dc6 commit 787701d

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

client/packages/lowcoder/src/comps/comps/dateComp/dateComp.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ import { RefControl } from "comps/controls/refControl";
4848
// import { CommonPickerMethods } from "antd/es/date-picker/generatePicker/interface";
4949
import { DateRangeUIView } from "comps/comps/dateComp/dateRangeUIView";
5050
import { EditorContext } from "comps/editorState";
51+
import { dropdownControl } from "comps/controls/dropdownControl";
52+
import { timeZoneOptions } from "./timeZone";
5153

5254
const EventOptions = [changeEvent, focusEvent, blurEvent] as const;
5355

@@ -80,6 +82,7 @@ const commonChildren = {
8082
...validationChildren,
8183
viewRef: RefControl<CommonPickerMethods>,
8284
inputFieldStyle: styleControl(DateTimeStyle, 'inputFieldStyle'),
85+
timeZone: dropdownControl(timeZoneOptions, "DatelineStandard"),
8386
};
8487
type CommonChildrenType = RecordConstructorToComp<typeof commonChildren>;
8588

@@ -224,6 +227,9 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
224227
placeholder: "2022-04-07 21:39:59",
225228
tooltip: trans("date.formatTip")
226229
})}
230+
{children.timeZone.propertyView({
231+
label: trans("prop.timeZone")
232+
})}
227233
</Section>
228234

229235
<FormDataPropertyView {...children} />
@@ -380,6 +386,9 @@ export const dateRangeControl = (function () {
380386
placeholder: "2022-04-07 21:39:59",
381387
tooltip: trans("date.formatTip"),
382388
})}
389+
{children.timeZone.propertyView({
390+
label: trans("prop.timeZone")
391+
})}
383392
</Section>
384393

385394
<FormDataPropertyView {...children} />

client/packages/lowcoder/src/comps/comps/dateComp/timeComp.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ import { RefControl } from "comps/controls/refControl";
5252
import { TimePickerProps } from "antd/es/time-picker";
5353

5454
import { EditorContext } from "comps/editorState";
55+
import { dropdownControl } from "comps/controls/dropdownControl";
56+
import { timeZoneOptions } from "./timeZone";
5557

5658
const EventOptions = [changeEvent, focusEvent, blurEvent] as const;
5759

@@ -81,6 +83,7 @@ const commonChildren = {
8183
),
8284
inputFieldStyle: styleControl(DateTimeStyle, 'inputFieldStyle'),
8385
suffixIcon: withDefault(IconControl, "/icon:regular/clock"),
86+
timeZone: dropdownControl(timeZoneOptions, "DatelineStandard"),
8487
viewRef: RefControl<CommonPickerMethods>,
8588
...validationChildren,
8689
};
@@ -196,7 +199,9 @@ export const timePickerControl = new UICompBuilder(childrenMap, (props) => {
196199
label: trans("prop.defaultValue"),
197200
tooltip: trans("time.formatTip"),
198201
})}
199-
202+
{children.timeZone.propertyView({
203+
label: trans("prop.timeZone")
204+
})}
200205
</Section>
201206

202207
<FormDataPropertyView {...children} />
@@ -336,6 +341,9 @@ export const timeRangeControl = (function () {
336341
label: trans("time.end"),
337342
tooltip: trans("time.formatTip"),
338343
})}
344+
{children.timeZone.propertyView({
345+
label: trans("prop.timeZone")
346+
})}
339347
</Section>
340348

341349
<FormDataPropertyView {...children} />
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export const timeZoneOptions = [
2+
{ label: "(UTC-12:00) International Date Line West", value: "DatelineStandard" },
3+
{ label: "(UTC-11:00) Coordinated Universal Time-11", value: "UTC11" },
4+
{ label: "(UTC-10:00) Hawaii", value: "HawaiianStandard" },
5+
{ label: "(UTC-09:00) Alaska", value: "AlaskanStandard" },
6+
{ label: "(UTC-08:00) Baja California", value: "PacificStandardMexico" },
7+
{ label: "(UTC-07:00) Pacific Daylight Time (US & Canada)", value: "PacificDaylight" },
8+
{ label: "(UTC-06:00) Central Time (US & Canada)", value: "CentralStandard" },
9+
{ label: "(UTC-05:00) Eastern Time (US & Canada)", value: "EasternStandard" },
10+
{ label: "(UTC-04:00) Atlantic Time (Canada)", value: "AtlanticStandard" },
11+
{ label: "(UTC-03:00) Buenos Aires", value: "ArgentinaStandard" },
12+
{ label: "(UTC-02:00) Coordinated Universal Time-02", value: "UTC02" },
13+
{ label: "(UTC-01:00) Cape Verde Is.", value: "CapeVerdeStandard" },
14+
{ label: "(UTC+00:00) Coordinated Universal Time", value: "UTC" },
15+
{ label: "(UTC+01:00) Amsterdam, Berlin, Rome, Vienna", value: "WEuropeStandard" },
16+
{ label: "(UTC+02:00) Athens, Bucharest", value: "GTBStandard" },
17+
{ label: "(UTC+03:00) Moscow, St. Petersburg", value: "MoscowStandard" },
18+
{ label: "(UTC+04:00) Abu Dhabi, Muscat", value: "ArabianStandard" },
19+
{ label: "(UTC+05:00) Islamabad, Karachi", value: "PakistanStandard" },
20+
{ label: "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi", value: "IndiaStandard" },
21+
{ label: "(UTC+06:00) Dhaka", value: "BangladeshStandard" },
22+
{ label: "(UTC+07:00) Bangkok, Hanoi, Jakarta", value: "SEAsiaStandard" },
23+
{ label: "(UTC+08:00) Beijing, Chongqing, Hong Kong", value: "ChinaStandard" },
24+
{ label: "(UTC+09:00) Tokyo, Seoul", value: "JapanStandard" },
25+
{ label: "(UTC+10:00) Sydney, Melbourne", value: "AUSEasternStandard" },
26+
{ label: "User Choice", value: "UserChoice" },
27+
];

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ export const en = {
222222
"horizontalGridCells": "Horizontal Grid Cells",
223223
"showHorizontalScrollbar": "Show Horizontal Scrollbar",
224224
"showVerticalScrollbar": "Show Vertical Scrollbar",
225+
"timeZone": "TimeZone",
225226
},
226227
"autoHeightProp": {
227228
"auto": "Auto",

0 commit comments

Comments
 (0)