@@ -11,6 +11,8 @@ import { default as DatePicker } from "antd/es/date-picker";
1111import { hasIcon } from "comps/utils" ;
1212import { omit } from "lodash" ;
1313import { DateParser } from "@lowcoder-ee/util/dateTimeUtils" ;
14+ import { default as AntdSelect } from "antd/es/select" ;
15+ import { timeZoneOptions } from "./timeZone" ;
1416
1517const { 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+ ` ;
2437const DateRangeMobileUIView = React . lazy ( ( ) =>
2538 import ( "./dateMobileUIView" ) . then ( ( m ) => ( { default : m . DateRangeMobileUIView } ) )
2639) ;
@@ -31,6 +44,7 @@ export interface DateRangeUIViewProps extends DateCompViewProps {
3144 placeholder ?: string | [ string , string ] ;
3245 onChange : ( start ?: dayjs . Dayjs | null , end ?: dayjs . Dayjs | null ) => void ;
3346 onPanelChange : ( value : any , mode : [ string , string ] ) => void ;
47+ onClickDateRangeTimeZone :( value :any ) => void
3448}
3549
3650export const DateRangeUIView = ( props : DateRangeUIViewProps ) => {
@@ -44,7 +58,6 @@ export const DateRangeUIView = (props: DateRangeUIViewProps) => {
4458 // Use the same placeholder for both start and end if it's a single string
4559 placeholders = [ props . placeholder || 'Start Date' , props . placeholder || 'End Date' ] ;
4660 }
47-
4861 return useUIView (
4962 < DateRangeMobileUIView { ...props } /> ,
5063 < RangePickerStyled
@@ -63,6 +76,18 @@ export const DateRangeUIView = (props: DateRangeUIViewProps) => {
6376 hourStep = { props . hourStep as any }
6477 minuteStep = { props . minuteStep as any }
6578 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+ ) }
6691 />
6792 ) ;
6893} ;
0 commit comments