Skip to content

Commit e31ceba

Browse files
committed
timeZone values added in modals
1 parent 787701d commit e31ceba

File tree

4 files changed

+82
-2
lines changed

4 files changed

+82
-2
lines changed

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { default as DatePicker } from "antd/es/date-picker";
1111
import { hasIcon } from "comps/utils";
1212
import { omit } from "lodash";
1313
import { DateParser } from "@lowcoder-ee/util/dateTimeUtils";
14+
import { default as AntdSelect } from "antd/es/select";
15+
import { timeZoneOptions } from "./timeZone";
1416

1517
const { RangePicker } = DatePicker;
1618

@@ -21,6 +23,17 @@ const RangePickerStyled = styled(RangePicker)<{$style: DateTimeStyleType}>`
2123
${(props) => props.$style && getStyle(props.$style)}
2224
`;
2325

26+
const StyledAntdSelect = styled(AntdSelect)`
27+
width: 400px;
28+
margin: 10px 0px;
29+
.ant-select-selector {
30+
font-size: 14px;
31+
line-height: 1.5;
32+
}
33+
`;
34+
const StyledDiv = styled.div`
35+
text-align: center;
36+
`;
2437
const DateRangeMobileUIView = React.lazy(() =>
2538
import("./dateMobileUIView").then((m) => ({ default: m.DateRangeMobileUIView }))
2639
);
@@ -44,7 +57,6 @@ export const DateRangeUIView = (props: DateRangeUIViewProps) => {
4457
// Use the same placeholder for both start and end if it's a single string
4558
placeholders = [props.placeholder || 'Start Date', props.placeholder || 'End Date'];
4659
}
47-
4860
return useUIView(
4961
<DateRangeMobileUIView {...props} />,
5062
<RangePickerStyled
@@ -63,6 +75,15 @@ export const DateRangeUIView = (props: DateRangeUIViewProps) => {
6375
hourStep={props.hourStep as any}
6476
minuteStep={props.minuteStep as any}
6577
secondStep={props.secondStep as any}
78+
renderExtraFooter={() => (
79+
<StyledDiv>
80+
<StyledAntdSelect
81+
placeholder="Select Time Zone"
82+
options={timeZoneOptions}
83+
onChange={()=>{console.log("handleTimeZoneChange")}}
84+
/>
85+
</StyledDiv>
86+
)}
6687
/>
6788
);
6889
};

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,27 @@ import { default as DatePicker } from "antd/es/date-picker";
1111
import type { DatePickerProps } from "antd/es/date-picker";
1212
import type { Dayjs } from 'dayjs';
1313
import { DateParser } from "@lowcoder-ee/util/dateTimeUtils";
14+
import { timeZoneOptions } from "./timeZone";
15+
import { default as AntdSelect } from "antd/es/select";
1416

1517
const DatePickerStyled = styled(DatePicker<Dayjs>)<{ $style: DateTimeStyleType }>`
1618
width: 100%;
1719
box-shadow: ${props=>`${props.$style.boxShadow} ${props.$style.boxShadowColor}`};
1820
${(props) => props.$style && getStyle(props.$style)}
1921
`;
2022

23+
const StyledDiv = styled.div`
24+
width: 100%;
25+
margin: 10px 0px;
26+
`;
27+
28+
const StyledAntdSelect = styled(AntdSelect)`
29+
width: 100%;
30+
.ant-select-selector {
31+
font-size: 14px;
32+
line-height: 1.5;
33+
}
34+
`;
2135

2236
export interface DataUIViewProps extends DateCompViewProps {
2337
value?: DatePickerProps<Dayjs>['value'];
@@ -48,6 +62,15 @@ export const DateUIView = (props: DataUIViewProps) => {
4862
picker={"date"}
4963
inputReadOnly={checkIsMobile(editorState?.getAppSettings().maxWidth)}
5064
placeholder={placeholder}
65+
renderExtraFooter={()=>(
66+
<StyledDiv>
67+
<StyledAntdSelect
68+
options={timeZoneOptions}
69+
placeholder="Select a time zone"
70+
onChange={()=>{console.log("DatePickerStyled")}}
71+
/>
72+
</StyledDiv>
73+
)}
5174
/>
5275
);
5376
};

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { EditorContext } from "../../editorState";
1010
import dayjs from "dayjs";
1111
import { hasIcon } from "comps/utils";
1212
import { omit } from "lodash";
13+
import { timeZoneOptions } from "./timeZone";
14+
import { default as AntdSelect } from "antd/es/select";
1315

1416
const { RangePicker } = TimePicker;
1517

@@ -18,6 +20,15 @@ const RangePickerStyled = styled((props: any) => <RangePicker {...props} />)<{ $
1820
${(props) => props.$style && getStyle(props.$style)}
1921
`;
2022

23+
const StyledAntdSelect = styled(AntdSelect)`
24+
width: 100%;
25+
margin: 10px 0px;
26+
.ant-select-selector {
27+
font-size: 14px;
28+
line-height: 1.5;
29+
}
30+
`;
31+
2132
const TimeRangeMobileUIView = React.lazy(() =>
2233
import("./timeMobileUIView").then((m) => ({ default: m.TimeRangeMobileUIView }))
2334
);
@@ -54,6 +65,13 @@ export const TimeRangeUIView = (props: TimeRangeUIViewProps) => {
5465
inputReadOnly={checkIsMobile(editorState?.getAppSettings().maxWidth)}
5566
suffixIcon={hasIcon(props.suffixIcon) && props.suffixIcon}
5667
placeholder={placeholders}
68+
renderExtraFooter={() => (
69+
<StyledAntdSelect
70+
placeholder="Select Time Zone"
71+
options={timeZoneOptions}
72+
onChange={()=>{console.log("handleTimeZoneChange")}}
73+
/>
74+
)}
5775
/>
5876
);
5977
};

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import React, { useContext } from "react";
88
import type { TimeCompViewProps } from "./timeComp";
99
import { EditorContext } from "../../editorState";
1010
import dayjs from "dayjs"
11+
import { default as AntdSelect } from "antd/es/select";
12+
import { timeZoneOptions } from "./timeZone";
1113

1214
const TimePickerStyled = styled(TimePicker)<{ $style: DateTimeStyleType }>`
1315
width: 100%;
@@ -17,6 +19,15 @@ const TimePickerStyled = styled(TimePicker)<{ $style: DateTimeStyleType }>`
1719
const TimeMobileUIView = React.lazy(() =>
1820
import("./timeMobileUIView").then((m) => ({ default: m.TimeMobileUIView }))
1921
);
22+
23+
const StyledAntdSelect = styled(AntdSelect)`
24+
width: 100%;
25+
margin: 10px 0;
26+
.ant-select-selector {
27+
font-size: 14px;
28+
padding: 8px;
29+
}
30+
`;
2031

2132
export interface TimeUIViewProps extends TimeCompViewProps {
2233
value: dayjs.Dayjs | null;
@@ -36,6 +47,13 @@ export const TimeUIView = (props: TimeUIViewProps) => {
3647
hideDisabledOptions
3748
inputReadOnly={checkIsMobile(editorState?.getAppSettings().maxWidth)}
3849
placeholder={placeholder}
39-
/>
50+
renderExtraFooter={()=>(
51+
<StyledAntdSelect
52+
placeholder="Select Time Zone"
53+
options={timeZoneOptions}
54+
onChange={()=>{console.log("handleTimeZoneChange")}}
55+
/>
56+
)}
57+
/>
4058
);
4159
};

0 commit comments

Comments
 (0)