fixed changelog date parsing issue (#13806)

# Before

<img width="3450" height="2078" alt="CleanShot 2025-08-11 at 11 25
25@2x"
src="https://github.com/user-attachments/assets/a6b53846-8012-453a-9ff8-2fd51f2d9efd"
/>

# After

<img width="3456" height="2076" alt="CleanShot 2025-08-11 at 11 25
37@2x"
src="https://github.com/user-attachments/assets/1784ebd7-6040-4ab3-9ca6-26efd5d240a0"
/>
This commit is contained in:
Thomas des Francs
2025-08-11 12:14:43 +02:00
committed by GitHub
parent d29dbd473b
commit 1b2987c5ff
32 changed files with 32 additions and 33 deletions
@@ -2,12 +2,11 @@ export const formatGithubPublishedAtDisplayDate = (
dateString: string,
): string => {
const date = new Date(dateString);
const currentYear = new Date().getFullYear();
const formatter = new Intl.DateTimeFormat('en-US', {
month: 'short',
day: 'numeric',
...(date.getFullYear() !== currentYear && { year: 'numeric' }),
year: 'numeric',
});
return formatter.format(date);