chore: handled the cycle date time using project timezone (#6187)
* chore: handled the cycle date time using project timezone * chore: reverted the frontend commit
This commit is contained in:
parent
38e8a5c807
commit
9ad8b43408
9 changed files with 185 additions and 54 deletions
|
|
@ -16,7 +16,7 @@ import {
|
|||
CustomEmojiIconPicker,
|
||||
EmojiIconPickerTypes,
|
||||
Tooltip,
|
||||
// CustomSearchSelect,
|
||||
CustomSearchSelect,
|
||||
} from "@plane/ui";
|
||||
// components
|
||||
import { Logo } from "@/components/common";
|
||||
|
|
@ -25,7 +25,7 @@ import { ImagePickerPopover } from "@/components/core";
|
|||
import { PROJECT_UPDATED } from "@/constants/event-tracker";
|
||||
import { NETWORK_CHOICES } from "@/constants/project";
|
||||
// helpers
|
||||
// import { TTimezone, TIME_ZONES } from "@/constants/timezones";
|
||||
import { TTimezone, TIME_ZONES } from "@/constants/timezones";
|
||||
import { renderFormattedDate } from "@/helpers/date-time.helper";
|
||||
import { convertHexEmojiToDecimal } from "@/helpers/emoji.helper";
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
|
|
@ -68,20 +68,20 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
|
|||
});
|
||||
// derived values
|
||||
const currentNetwork = NETWORK_CHOICES.find((n) => n.key === project?.network);
|
||||
// const getTimeZoneLabel = (timezone: TTimezone | undefined) => {
|
||||
// if (!timezone) return undefined;
|
||||
// return (
|
||||
// <div className="flex gap-1.5">
|
||||
// <span className="text-custom-text-400">{timezone.gmtOffset}</span>
|
||||
// <span className="text-custom-text-200">{timezone.name}</span>
|
||||
// </div>
|
||||
// );
|
||||
// };
|
||||
// const timeZoneOptions = TIME_ZONES.map((timeZone) => ({
|
||||
// value: timeZone.value,
|
||||
// query: timeZone.name + " " + timeZone.gmtOffset + " " + timeZone.value,
|
||||
// content: getTimeZoneLabel(timeZone),
|
||||
// }));
|
||||
const getTimeZoneLabel = (timezone: TTimezone | undefined) => {
|
||||
if (!timezone) return undefined;
|
||||
return (
|
||||
<div className="flex gap-1.5">
|
||||
<span className="text-custom-text-400">{timezone.gmtOffset}</span>
|
||||
<span className="text-custom-text-200">{timezone.name}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const timeZoneOptions = TIME_ZONES.map((timeZone) => ({
|
||||
value: timeZone.value,
|
||||
query: timeZone.name + " " + timeZone.gmtOffset + " " + timeZone.value,
|
||||
content: getTimeZoneLabel(timeZone),
|
||||
}));
|
||||
const coverImage = watch("cover_image_url");
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -146,7 +146,7 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
|
|||
description: formData.description,
|
||||
|
||||
logo_props: formData.logo_props,
|
||||
// timezone: formData.timezone,
|
||||
timezone: formData.timezone,
|
||||
};
|
||||
// if unsplash or a pre-defined image is uploaded, delete the old uploaded asset
|
||||
if (formData.cover_image_url?.startsWith("http")) {
|
||||
|
|
@ -386,7 +386,7 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
|
|||
}}
|
||||
/>
|
||||
</div>
|
||||
{/* <div className="flex flex-col gap-1 col-span-1 sm:col-span-2 xl:col-span-1">
|
||||
<div className="flex flex-col gap-1 col-span-1 sm:col-span-2 xl:col-span-1">
|
||||
<h4 className="text-sm">Project Timezone</h4>
|
||||
<Controller
|
||||
name="timezone"
|
||||
|
|
@ -410,7 +410,7 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
|
|||
)}
|
||||
/>
|
||||
{errors.timezone && <span className="text-xs text-red-500">{errors.timezone.message}</span>}
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center justify-between py-2">
|
||||
<>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue