فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(A03): validate Jalali calendar dates, not only their format
davoodmehraban89 committed
Oct 20, 2026 at 08:44 UTC
32d26c61913e7e95c08e52015751b5d829dd403f
1 file changed
+4
-2
src/core/AuditService.js
+4
-2
@@ -18,8 +18,10 @@ const VALID_TYPES = new Set([
18
'opening_posted'
19
]);
20
const validId = value => typeof value === 'string' && value.trim().length > 0 && value.length <= 256;
21
-const validBusinessDate = value => value === null ||
22
- (typeof value === 'string' && /^\d{4}\/\d{2}\/\d{2}$/.test(value));
21
+const validBusinessDate = value => {
22
+ if (value === null) return true;
23
+ try { assertJalaliDate(value); return true; } catch { return false; }
24
+};
25
26
class AuditServiceImpl {
27
/**