This commit is contained in:
hamid zarghami
2025-05-11 12:04:10 +03:30
parent 62e8637a99
commit f7df0f8790
2 changed files with 7 additions and 1 deletions
+4
View File
@@ -8,6 +8,10 @@ const convertNumbersInDOM = (node: Node): void => {
if (node.nodeType === Node.TEXT_NODE) { if (node.nodeType === Node.TEXT_NODE) {
node.nodeValue = toPersianDigits(node.nodeValue || ""); node.nodeValue = toPersianDigits(node.nodeValue || "");
} else if (node.nodeType === Node.ELEMENT_NODE) { } else if (node.nodeType === Node.ELEMENT_NODE) {
// Skip conversion if element has 'en' class
if ((node as Element).classList?.contains("en")) {
return;
}
node.childNodes.forEach(convertNumbersInDOM); node.childNodes.forEach(convertNumbersInDOM);
} }
}; };
+3 -1
View File
@@ -39,7 +39,9 @@ const MyDiscountList: FC = () => {
<tr key={item.id} className='tr'> <tr key={item.id} className='tr'>
<Td text={String(index + 1)} /> <Td text={String(index + 1)} />
<Td text={t(`discount.${item.type}`)} /> <Td text={t(`discount.${item.type}`)} />
<Td text={item.code} /> <Td text={''}>
<div className='en'>{item.code}</div>
</Td>
<Td text={moment(item.startDate).format('jYYYY-jMM-jDD')} /> <Td text={moment(item.startDate).format('jYYYY-jMM-jDD')} />
<Td text={moment(item.endDate).format('jYYYY-jMM-jDD')} /> <Td text={moment(item.endDate).format('jYYYY-jMM-jDD')} />
<Td text={''}> <Td text={''}>