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(messages): added date info to messages #437

Merged
merged 7 commits into from
Feb 8, 2024

Conversation

EgeOnder
Copy link
Contributor

@EgeOnder EgeOnder commented Feb 5, 2024

Closes #435

Screenshot 2024-02-05 at 17 02 56 Screenshot 2024-02-05 at 17 03 22

@EgeOnder EgeOnder requested a review from a team as a code owner February 5, 2024 05:16
@github-actions github-actions bot added the cc-feat PR includes feature commit label Feb 5, 2024
@github-actions github-actions bot added cc-feat PR includes feature commit and removed cc-feat PR includes feature commit labels Feb 5, 2024
@github-actions github-actions bot added cc-feat PR includes feature commit and removed cc-feat PR includes feature commit labels Feb 5, 2024
@Bri74
Copy link
Contributor

Bri74 commented Feb 6, 2024

@EgeOnder well done! Can you provide a date-time format? Thank you!

@EgeOnder
Copy link
Contributor Author

EgeOnder commented Feb 6, 2024

@EgeOnder well done! Can you provide a date-time format? Thank you!

It uses the already built-in utility function:

export const formatReadableDate = (date: Date, short = false) => {
return DateTime.fromJSDate(date, {
zone: IANAZone.create('Europe/Rome'),
}).toLocaleString({
month: short ? 'short' : 'long',
day: 'numeric',
});
};

But there are a couple of them, maybe you prefer:

export const formatDate = (date: Date) => {
return DateTime.fromJSDate(date, {
zone: IANAZone.create('Europe/Rome'),
}).toFormat('dd/MM/yyyy');
};

Currently, it uses the first one, but let me know which one is correct.

With the second one, it looks like this:
Screenshot 2024-02-06 at 21 05 53

@github-actions github-actions bot added cc-feat PR includes feature commit and removed cc-feat PR includes feature commit labels Feb 6, 2024
@Bri74
Copy link
Contributor

Bri74 commented Feb 7, 2024

@EgeOnder you can use the same format in the subtitle on the message list (formatDateTime)
Image (3)

@github-actions github-actions bot added cc-feat PR includes feature commit and removed cc-feat PR includes feature commit labels Feb 8, 2024
@EgeOnder
Copy link
Contributor Author

EgeOnder commented Feb 8, 2024

@EgeOnder you can use the same format in the subtitle on the message list (formatDateTime) Image (3)

Done

Screenshot 2024-02-08 at 02 11 04

@github-actions github-actions bot added cc-feat PR includes feature commit and removed cc-feat PR includes feature commit labels Feb 8, 2024
@Bri74 Bri74 merged commit 1fa7a3f into polito:main Feb 8, 2024
7 of 9 checks passed
@EgeOnder EgeOnder deleted the feat/date-info branch February 9, 2024 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cc-feat PR includes feature commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "sentOn" date on messages
2 participants