Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): allow to display date in absolute format #12986

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KillianHmyd
Copy link

Fixes #TODO

Motivation

Modifications

Verification

Copy link
Member

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fill out the PR template. The "Motivation" section is particularly relevant here.
DCO is also missing from your commit.

There's also some bugs in the current code and this should apply on a much broader scale if implemented, see below in-line comments

@@ -13,7 +13,7 @@ export function Timestamp({date}: {date: Date | string | number}) {
'-'
) : (
<span title={tooltip(date)}>
<Ticker intervalMs={1000}>{() => ago(new Date(date))}</Ticker>
<Ticker intervalMs={1000}>{() => (displayFullDate ? new Date(date).toISOString() : ago(new Date(date)))}</Ticker>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This displays how long ago a date was, not the date itself. If anything you'd want to do this conversion on the date after ago

@@ -3,7 +3,7 @@ import * as React from 'react';

import {ago} from '../duration';

export function Timestamp({date}: {date: Date | string | number}) {
export function Timestamp({date, displayFullDate = false}: {date: Date | string | number; displayFullDate?: boolean}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be passed through context, as it should be a global, not a prop passed through many components

@@ -308,6 +310,16 @@ export function WorkflowsList({match, location, history}: RouteComponentProps<an
);
})}
</div>
<label htmlFor='date_format_checkbox'>Show absolute date</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should this be isolated to the WorkflowsList page? There are other pages with dates.

In #12943 (comment), I suggested in a global settings page, and also storing that in localStorage, not just temporary state.

@agilgur5 agilgur5 changed the title feat: allow to display date in absolute format feat(ui): allow to display date in absolute format Apr 26, 2024
@agilgur5 agilgur5 added the problem/more information needed Not enough information has been provide to diagnose this issue. label May 4, 2024
@JPZ13
Copy link
Member

JPZ13 commented May 6, 2024

@KillianHmyd - are you going to continue developing this PR? We've got a customer asking for it. If you don't have time to work through it, would you mind if we contributed the PR and had you do a review?

@KillianHmyd
Copy link
Author

@agilgur5 Sorry this was a draft not meant at all to be reviewed/shared for now 🙏🏾
@JPZ13 You can go for it I won't work on it during the following week

@JPZ13
Copy link
Member

JPZ13 commented May 13, 2024

Thanks @KillianHmyd - I really appreciate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui problem/more information needed Not enough information has been provide to diagnose this issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants