diff --git a/apps/app/components/core/filters/issues-view-filter.tsx b/apps/app/components/core/filters/issues-view-filter.tsx index 4452bfb61..67b2423ec 100644 --- a/apps/app/components/core/filters/issues-view-filter.tsx +++ b/apps/app/components/core/filters/issues-view-filter.tsx @@ -270,9 +270,16 @@ export const IssuesFilterView: React.FC = () => { if (key === "estimate" && !isEstimateActive) return null; if ( - (issueView === "spreadsheet" && key === "attachment_count") || - (issueView === "spreadsheet" && key === "link") || - (issueView === "spreadsheet" && key === "sub_issue_count") + issueView === "spreadsheet" && + (key === "attachment_count" || + key === "link" || + key === "sub_issue_count") + ) + return null; + + if ( + issueView !== "spreadsheet" && + (key === "created_on" || key === "updated_on") ) return null; diff --git a/apps/app/components/core/spreadsheet-view/single-issue.tsx b/apps/app/components/core/spreadsheet-view/single-issue.tsx index ada1e3689..579dcb698 100644 --- a/apps/app/components/core/spreadsheet-view/single-issue.tsx +++ b/apps/app/components/core/spreadsheet-view/single-issue.tsx @@ -42,6 +42,7 @@ import { import { ICurrentUserResponse, IIssue, ISubIssueResponse, Properties, UserAuth } from "types"; // helper import { copyTextToClipboard } from "helpers/string.helper"; +import { renderLongDetailDateFormat } from "helpers/date-time.helper"; type Props = { issue: IIssue; @@ -345,6 +346,16 @@ export const SingleSpreadsheetIssue: React.FC = ({ /> )} + {properties.created_on && ( +
+ {renderLongDetailDateFormat(issue.created_at)} +
+ )} + {properties.updated_on && ( +
+ {renderLongDetailDateFormat(issue.updated_at)} +
+ )} ); }; diff --git a/apps/app/components/core/spreadsheet-view/spreadsheet-columns.tsx b/apps/app/components/core/spreadsheet-view/spreadsheet-columns.tsx index a0f404fba..b05a5e82b 100644 --- a/apps/app/components/core/spreadsheet-view/spreadsheet-columns.tsx +++ b/apps/app/components/core/spreadsheet-view/spreadsheet-columns.tsx @@ -123,7 +123,9 @@ export const SpreadsheetColumns: React.FC = ({ columnData, gridTemplateCo Z - ) : col.propertyName === "due_date" ? ( + ) : col.propertyName === "due_date" || + col.propertyName === "created_on" || + col.propertyName === "updated_on" ? ( <> month: "short", }); +export const renderLongDetailDateFormat = (date: string | Date) => + new Date(date).toLocaleDateString("en-UK", { + day: "numeric", + month: "long", + year: "numeric", + }); + export const findHowManyDaysLeft = (date: string | Date) => { const today = new Date(); const eventDate = new Date(date); diff --git a/apps/app/hooks/use-issue-properties.tsx b/apps/app/hooks/use-issue-properties.tsx index 163dcdcd2..443adf4f0 100644 --- a/apps/app/hooks/use-issue-properties.tsx +++ b/apps/app/hooks/use-issue-properties.tsx @@ -18,6 +18,8 @@ const initialValues: Properties = { attachment_count: false, link: false, estimate: false, + created_on: false, + updated_on: false, }; const useIssuesProperties = (workspaceSlug?: string, projectId?: string) => { @@ -96,6 +98,8 @@ const useIssuesProperties = (workspaceSlug?: string, projectId?: string) => { attachment_count: properties.attachment_count, link: properties.link, estimate: properties.estimate, + created_on: properties.created_on, + updated_on: properties.updated_on, }; return [newProperties, updateIssueProperties] as const; diff --git a/apps/app/hooks/use-my-issues-filter.tsx b/apps/app/hooks/use-my-issues-filter.tsx index 8c5d3eaa5..46554aa43 100644 --- a/apps/app/hooks/use-my-issues-filter.tsx +++ b/apps/app/hooks/use-my-issues-filter.tsx @@ -19,6 +19,8 @@ const initialValues: Properties = { attachment_count: false, link: false, estimate: false, + created_on: false, + updated_on: false, }; const useMyIssuesProperties = (workspaceSlug?: string) => { @@ -92,6 +94,8 @@ const useMyIssuesProperties = (workspaceSlug?: string) => { attachment_count: properties.attachment_count, link: properties.link, estimate: properties.estimate, + created_on: properties.created_on, + updated_on: properties.updated_on, }; return [newProperties, updateIssueProperties] as const; diff --git a/apps/app/types/issues.d.ts b/apps/app/types/issues.d.ts index aac0ec4eb..0792bcd6d 100644 --- a/apps/app/types/issues.d.ts +++ b/apps/app/types/issues.d.ts @@ -188,6 +188,8 @@ export type Properties = { link: boolean; attachment_count: boolean; estimate: boolean; + created_on: boolean; + updated_on: boolean; }; export interface IIssueLabels { diff --git a/apps/app/types/workspace.d.ts b/apps/app/types/workspace.d.ts index ee0458bfe..6d468c637 100644 --- a/apps/app/types/workspace.d.ts +++ b/apps/app/types/workspace.d.ts @@ -45,6 +45,8 @@ export type Properties = { link: boolean; attachment_count: boolean; estimate: boolean; + created_on: boolean; + updated_on: boolean; }; export interface IWorkspaceMember {