@@ -11,6 +11,8 @@ import { default as DatePicker } from "antd/es/date-picker";
11
11
import { hasIcon } from "comps/utils" ;
12
12
import { omit } from "lodash" ;
13
13
import { DateParser } from "@lowcoder-ee/util/dateTimeUtils" ;
14
+ import { default as AntdSelect } from "antd/es/select" ;
15
+ import { timeZoneOptions } from "./timeZone" ;
14
16
15
17
const { RangePicker } = DatePicker ;
16
18
@@ -21,6 +23,17 @@ const RangePickerStyled = styled(RangePicker)<{$style: DateTimeStyleType}>`
21
23
${ ( props ) => props . $style && getStyle ( props . $style ) }
22
24
` ;
23
25
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
+ ` ;
24
37
const DateRangeMobileUIView = React . lazy ( ( ) =>
25
38
import ( "./dateMobileUIView" ) . then ( ( m ) => ( { default : m . DateRangeMobileUIView } ) )
26
39
) ;
@@ -31,6 +44,7 @@ export interface DateRangeUIViewProps extends DateCompViewProps {
31
44
placeholder ?: string | [ string , string ] ;
32
45
onChange : ( start ?: dayjs . Dayjs | null , end ?: dayjs . Dayjs | null ) => void ;
33
46
onPanelChange : ( value : any , mode : [ string , string ] ) => void ;
47
+ onClickDateRangeTimeZone :( value :any ) => void
34
48
}
35
49
36
50
export const DateRangeUIView = ( props : DateRangeUIViewProps ) => {
@@ -44,7 +58,6 @@ export const DateRangeUIView = (props: DateRangeUIViewProps) => {
44
58
// Use the same placeholder for both start and end if it's a single string
45
59
placeholders = [ props . placeholder || 'Start Date' , props . placeholder || 'End Date' ] ;
46
60
}
47
-
48
61
return useUIView (
49
62
< DateRangeMobileUIView { ...props } /> ,
50
63
< RangePickerStyled
@@ -63,6 +76,18 @@ export const DateRangeUIView = (props: DateRangeUIViewProps) => {
63
76
hourStep = { props . hourStep as any }
64
77
minuteStep = { props . minuteStep as any }
65
78
secondStep = { props . secondStep as any }
79
+ renderExtraFooter = { ( ) => (
80
+ props . timeZone === "UserChoice" && (
81
+ < StyledDiv >
82
+ < StyledAntdSelect
83
+ options = { timeZoneOptions . filter ( option => option . value !== 'UserChoice' ) }
84
+ placeholder = "Select Time Zone"
85
+ defaultValue = { 'Etc/UTC' }
86
+ onChange = { props ?. onClickDateRangeTimeZone }
87
+ />
88
+ </ StyledDiv >
89
+ )
90
+ ) }
66
91
/>
67
92
) ;
68
93
} ;
0 commit comments