Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Add/time zone#1144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
FalkWolsky merged 7 commits intolowcoder-org:devfromMenamAfzal:add/timeZone
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
315 changes: 270 additions & 45 deletionsclient/packages/lowcoder/src/comps/comps/dateComp/dateComp.tsx
View file
Open in desktop

Large diffs are not rendered by default.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,8 @@ import { default as DatePicker } from "antd/es/date-picker";
import { hasIcon } from "comps/utils";
import { omit } from "lodash";
import { DateParser } from "@lowcoder-ee/util/dateTimeUtils";
import { default as AntdSelect } from "antd/es/select";
import { timeZoneOptions } from "./timeZone";

const { RangePicker } = DatePicker;

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

const StyledAntdSelect = styled(AntdSelect)`
width: 400px;
margin: 10px 0px;
.ant-select-selector {
font-size: 14px;
line-height: 1.5;
}
`;
const StyledDiv = styled.div`
text-align: center;
`;
const DateRangeMobileUIView = React.lazy(() =>
import("./dateMobileUIView").then((m) => ({ default: m.DateRangeMobileUIView }))
);
Expand All@@ -31,6 +44,7 @@ export interface DateRangeUIViewProps extends DateCompViewProps {
placeholder?: string | [string, string];
onChange: (start?: dayjs.Dayjs | null, end?: dayjs.Dayjs | null) => void;
onPanelChange: (value: any, mode: [string, string]) => void;
onClickDateRangeTimeZone:(value:any)=>void
}

export const DateRangeUIView = (props: DateRangeUIViewProps) => {
Expand All@@ -44,7 +58,6 @@ export const DateRangeUIView = (props: DateRangeUIViewProps) => {
// Use the same placeholder for both start and end if it's a single string
placeholders = [props.placeholder || 'Start Date', props.placeholder || 'End Date'];
}

return useUIView(
<DateRangeMobileUIView {...props} />,
<RangePickerStyled
Expand All@@ -63,6 +76,18 @@ export const DateRangeUIView = (props: DateRangeUIViewProps) => {
hourStep={props.hourStep as any}
minuteStep={props.minuteStep as any}
secondStep={props.secondStep as any}
renderExtraFooter={() => (
props.timeZone === "UserChoice" && (
<StyledDiv>
<StyledAntdSelect
options={timeZoneOptions.filter(option => option.value !== 'UserChoice')}
placeholder="Select Time Zone"
defaultValue={'Etc/UTC'}
onChange={props?.onClickDateRangeTimeZone}
/>
</StyledDiv>
)
)}
/>
);
};
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,18 +11,34 @@ import { default as DatePicker } from "antd/es/date-picker";
import type { DatePickerProps } from "antd/es/date-picker";
import type { Dayjs } from 'dayjs';
import { DateParser } from "@lowcoder-ee/util/dateTimeUtils";
import { timeZoneOptions } from "./timeZone";
import { default as AntdSelect } from "antd/es/select";

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

const StyledDiv = styled.div`
width: 100%;
margin: 10px 0px;
`;

const StyledAntdSelect = styled(AntdSelect)`
width: 100%;
.ant-select-selector {
font-size: 14px;
line-height: 1.5;
}
`;

export interface DataUIViewProps extends DateCompViewProps {
value?: DatePickerProps<Dayjs>['value'];
onChange: DatePickerProps<Dayjs>['onChange'];
onPanelChange: () => void;
onClickDateTimeZone:(value:any)=>void;

}

const DateMobileUIView = React.lazy(() =>
Expand All@@ -48,6 +64,18 @@ export const DateUIView = (props: DataUIViewProps) => {
picker={"date"}
inputReadOnly={checkIsMobile(editorState?.getAppSettings().maxWidth)}
placeholder={placeholder}
renderExtraFooter={()=>(
props.timeZone === "UserChoice" && (
<StyledDiv>
<StyledAntdSelect
options={timeZoneOptions.filter(option => option.value !== 'UserChoice')}
placeholder="Select Time Zone"
defaultValue={'Etc/UTC'}
onChange={props.onClickDateTimeZone}
/>
</StyledDiv>
)
)}
/>
);
};
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp