Fix wrong month shown for different system date formats

pull/375/head
Lim Chee Aun 2023-12-29 14:27:43 +08:00
rodzic f21a65da9a
commit 2240380f68
1 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -377,14 +377,14 @@ function AccountStatuses() {
}
: {},
);
const [year, month] = value.split('-');
const monthIndex = parseInt(month, 10) - 1;
const date = new Date(year, monthIndex);
showToast(
`Showing posts in ${new Date(value).toLocaleString(
'default',
{
`Showing posts in ${date.toLocaleString('default', {
month: 'long',
year: 'numeric',
},
)}`,
})}`,
);
}}
/>