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

RelativeTime #299

Merged
merged 28 commits into from Oct 6, 2022
Merged

RelativeTime #299

merged 28 commits into from Oct 6, 2022

Conversation

josepmartins
Copy link
Contributor

@josepmartins josepmartins commented Sep 22, 2022

@josepmartins josepmartins changed the title RelativeTime [WIP] RelativeTime Sep 22, 2022
@josepmartins josepmartins temporarily deployed to github-pages September 22, 2022 14:26 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 23, 2022 14:26 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 23, 2022 15:37 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 23, 2022 15:40 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 26, 2022 10:38 Inactive
@josepmartins josepmartins marked this pull request as ready for review September 26, 2022 10:43
@josepmartins josepmartins requested a review from a team as a code owner September 26, 2022 10:43
@josepmartins josepmartins changed the title [WIP] RelativeTime RelativeTime Sep 26, 2022
@josepmartins josepmartins temporarily deployed to github-pages September 26, 2022 10:45 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 26, 2022 10:51 Inactive
@maximedegreve
Copy link
Contributor

maximedegreve commented Sep 26, 2022

This is great!

I'm wondering if we could make it even better by adding a table with all the formats and examples.
When I'm designing this would save me time having to google for my use case what formats I can use.

When Format Example
1 day >= D MMM, YYYY 14 May, 2020

@lukasoppermann
Copy link
Contributor

Hey, in the figma file (I am assuming you meant to link to phase 2 instead if phase 1) you have the following code:

<RelativeTime micro={{narrow: true}}  datetime={Date} />

Why do you have to set the micro property to narrow: true? Wouldn't it be better to do micro=true or even better narrow=true?

josepmartins and others added 2 commits September 27, 2022 13:09
Co-authored-by: Lukas Oppermann <lukasoppermann@github.com>
Co-authored-by: Lukas Oppermann <lukasoppermann@github.com>
@josepmartins josepmartins temporarily deployed to github-pages September 27, 2022 11:12 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 27, 2022 11:25 Inactive
Co-authored-by: Lukas Oppermann <lukasoppermann@github.com>
@josepmartins josepmartins temporarily deployed to github-pages September 27, 2022 11:52 Inactive
@josepmartins
Copy link
Contributor Author

Hey, in the figma file (I am assuming you meant to link to phase 2 instead if phase 1) you have the following code:

<RelativeTime micro={{narrow: true}}  datetime={Date} />

Why do you have to set the micro property to narrow: true? Wouldn't it be better to do micro=true or even better narrow=true?

Right! I changed the link 👍 .

Following the same approach as the hidden option in the SplitLayout or the variant in the SegmentControl component, the idea is to provide a range of responsive widths (narrow, regular, wide) for the micro format, so an example of the API using micro in narrow spaces looks like:

<RelativeTime micro={{narrow: true, regular: false, wide: false}} datetime={new Date("2022-12-26")}>

@josepmartins
Copy link
Contributor Author

This is great!

I'm wondering if we could make it even better by adding a table with all the formats and examples. When I'm designing this would save me time having to google for my use case what formats I can use.

When Format Example
1 day >= D MMM, YYYY 14 May, 2020

Good idea 👍 I'll add it as part of the content section.

@josepmartins josepmartins temporarily deployed to github-pages September 27, 2022 12:03 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 27, 2022 15:58 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 27, 2022 16:01 Inactive
@josepmartins josepmartins temporarily deployed to github-pages September 29, 2022 13:38 Inactive
content/components/relative-time.mdx Outdated Show resolved Hide resolved
content/components/relative-time.mdx Outdated Show resolved Hide resolved
content/components/relative-time.mdx Outdated Show resolved Hide resolved
@josepmartins josepmartins temporarily deployed to github-pages September 30, 2022 11:27 Inactive
@josepmartins josepmartins temporarily deployed to github-pages October 3, 2022 09:08 Inactive
Copy link
Contributor

@simurai simurai left a comment

Choose a reason for hiding this comment

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

Added two suggestions, otherwise I think this is ✨

content/components/relative-time.mdx Outdated Show resolved Hide resolved
content/components/relative-time.mdx Outdated Show resolved Hide resolved
josepmartins and others added 2 commits October 5, 2022 11:19
Co-authored-by: simurai <simurai@github.com>
Co-authored-by: simurai <simurai@github.com>
@josepmartins josepmartins temporarily deployed to github-pages October 5, 2022 09:22 Inactive
@josepmartins josepmartins merged commit d25be6d into main Oct 6, 2022
@josepmartins josepmartins deleted the josepmartins/relative-time-guidelines branch October 6, 2022 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants