fix: Problem when using Brazilian Portuguese

This commit is contained in:
iamsivin
2023-05-19 15:51:41 +05:30
parent 7b9a9831c1
commit 6d07a7d92e
+2 -1
View File
@@ -39,7 +39,8 @@ export const getUnixStartOfDay = date => getUnixTime(startOfDay(date));
export const getUnixEndOfDay = date => getUnixTime(endOfDay(date));
export const generateRelativeTime = (value, unit, languageCode) => {
const rtf = new Intl.RelativeTimeFormat(languageCode, {
const code = languageCode.replace(/_/g, '-'); // Hacky fix we need to handle it from source
const rtf = new Intl.RelativeTimeFormat(code, {
numeric: 'auto',
});
return rtf.format(value, unit);