From 71ebd9233df1f4f1b7a416ca43dfd22fbdca3900 Mon Sep 17 00:00:00 2001 From: skyflow-bharti <118584001+skyflow-bharti@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:48:47 +0530 Subject: [PATCH 1/4] SK-2675 fix date validation for month (#683) * SK-2610 fix the type gap to pass the nested objects * SK-2675 fix the date validation * SK-2675 add unit test for fixing the date validation * SK-2675 undo style change --- src/utils/validators/index.ts | 3 +- tests/utils/validators.test.js | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/utils/validators/index.ts b/src/utils/validators/index.ts index f4ce7a88..48f681cd 100644 --- a/src/utils/validators/index.ts +++ b/src/utils/validators/index.ts @@ -78,6 +78,8 @@ export const validateExpiryDate = (date: string, format: string) => { if (!date.includes('/')) return false; const { month, year } = getYearAndMonthBasedOnFormat(date, format); if (format.endsWith('YYYY') && year.toString().length !== 4) { return false; } + const monthNum = Number(month); + if (monthNum < 1 || monthNum > 12) { return false; } const expiryDate = new Date(Number(year), Number(month), 0); expiryDate.setHours(23, 59, 59, 999); const today = new Date(); @@ -85,7 +87,6 @@ export const validateExpiryDate = (date: string, format: string) => { const maxDate = new Date(); maxDate.setFullYear(today.getFullYear() + 50); maxDate.setMonth(today.getMonth() + 1); - return expiryDate >= today && expiryDate <= maxDate; }; diff --git a/tests/utils/validators.test.js b/tests/utils/validators.test.js index c67b5b7e..c1ef6763 100644 --- a/tests/utils/validators.test.js +++ b/tests/utils/validators.test.js @@ -66,6 +66,56 @@ describe('Validation card number and Expiry Date', () => { expect(validateExpiryDate(expiryDate, "MM/YY")).toBe(false); }); + test('validate expiry date with month 00, MM/YY', () => { + const expiryDate = '00/45'; + expect(validateExpiryDate(expiryDate, "MM/YY")).toBe(false); + }); + + test('validate expiry date with month 13, MM/YY', () => { + const expiryDate = '13/45'; + expect(validateExpiryDate(expiryDate, "MM/YY")).toBe(false); + }); + + test('validate expiry date with month 00, YY/MM', () => { + const expiryDate = '45/00'; + expect(validateExpiryDate(expiryDate, "YY/MM")).toBe(false); + }); + + test('validate expiry date with month 13, YY/MM', () => { + const expiryDate = '45/13'; + expect(validateExpiryDate(expiryDate, "YY/MM")).toBe(false); + }); + + test('validate expiry date with month 00, YYYY/MM', () => { + const expiryDate = '2045/00'; + expect(validateExpiryDate(expiryDate, "YYYY/MM")).toBe(false); + }); + + test('validate expiry date with month 13, YYYY/MM', () => { + const expiryDate = '2045/13'; + expect(validateExpiryDate(expiryDate, "YYYY/MM")).toBe(false); + }); + + test('validate older expiry date with month 00, YYYY/MM', () => { + const expiryDate = '2024/00'; + expect(validateExpiryDate(expiryDate, "YYYY/MM")).toBe(false); + }); + + test('validate older expiry date with month 13, YYYY/MM', () => { + const expiryDate = '2024/13'; + expect(validateExpiryDate(expiryDate, "YYYY/MM")).toBe(false); + }); + + test('validate expiry date with month 00, MM/YYYY', () => { + const expiryDate = '00/2045'; + expect(validateExpiryDate(expiryDate, "MM/YYYY")).toBe(false); + }); + + test('validate expiry date with month 13, MM/YYYY', () => { + const expiryDate = '13/2045'; + expect(validateExpiryDate(expiryDate, "MM/YYYY")).toBe(false); + }); + test('validate expired date, MM/YY', () => { const currentDate = new Date(); const expiryDate = `${currentDate.getMonth()}/${currentDate.getFullYear().toString().slice(-2)}`; From 97de422ea9f3cb04de75b6566750d66db9c12296 Mon Sep 17 00:00:00 2001 From: skyflow-bharti Date: Thu, 26 Mar 2026 05:19:16 +0000 Subject: [PATCH 2/4] [AUTOMATED] Release - 2.7.3-dev.71ebd92 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f9d50a2..a5833ec5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "skyflow-js", "preferGlobal": true, "analyze": false, - "version": "2.7.3", + "version": "2.7.3-dev.71ebd92", "author": "Skyflow", "description": "Skyflow JavaScript SDK", "homepage": "https://github.com/skyflowapi/skyflow-js", From 3a4806ec2b8c455f73f59f2a7a5218e10e9b5756 Mon Sep 17 00:00:00 2001 From: skyflow-bharti <118584001+skyflow-bharti@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:53:27 +0530 Subject: [PATCH 3/4] SK-2610 fix the type gap in styles to allow user to pass the nested objects (#682) * SK-2610 fix the type gap to pass the nested objects --- .../collect-element-listeners/src/index.ts | 3 +++ .../composable-elements/src/index.ts | 5 ++++- src/utils/common/index.ts | 22 ++++++++++--------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/samples/using-typescript/collect-element-listeners/src/index.ts b/samples/using-typescript/collect-element-listeners/src/index.ts index ebf27c1e..f3a9e015 100644 --- a/samples/using-typescript/collect-element-listeners/src/index.ts +++ b/samples/using-typescript/collect-element-listeners/src/index.ts @@ -53,6 +53,9 @@ try { borderRadius: '4px', color: '#1d1d1d', marginTop: '4px', + "&:hover": { +      borderColor: "green", +    }, }, complete: { color: '#4caf50', diff --git a/samples/using-typescript/composable-elements/src/index.ts b/samples/using-typescript/composable-elements/src/index.ts index 9a81f01f..5eea46fe 100644 --- a/samples/using-typescript/composable-elements/src/index.ts +++ b/samples/using-typescript/composable-elements/src/index.ts @@ -57,7 +57,10 @@ try { fontWeight: '400', fontSize: '14px', lineHeight: '21px', - width: '294px' + width: '294px', + "&:hover": { +      borderColor: "green", +     }, }, global: { '@import' :'url("https://fonts.googleapis.com/css2?family=Roboto&display=swap")', diff --git a/src/utils/common/index.ts b/src/utils/common/index.ts index 26baa018..ecf72435 100644 --- a/src/utils/common/index.ts +++ b/src/utils/common/index.ts @@ -291,6 +291,8 @@ export interface DeleteErrorRecords { error: ErrorRecord, } +export type Style = string | { [key: string]: Style }; + export interface ContainerOptions { layout: number[], styles?: InputStyles, // check implementation below @@ -298,22 +300,22 @@ export interface ContainerOptions { } export interface ErrorTextStyles { - base?: Record, - global?: Record, + base?: Record, + global?: Record, } export interface LabelStyles extends ErrorTextStyles { - focus?: Record, - requiredAsterisk?: Record, + focus?: Record, + requiredAsterisk?: Record, } export interface InputStyles extends ErrorTextStyles { - focus?: Record, - complete?: Record, - empty?: Record, - invalid?: Record, - cardIcon?: Record, - copyIcon?: Record, + focus?: Record, + complete?: Record, + empty?: Record, + invalid?: Record, + cardIcon?: Record, + copyIcon?: Record, } export interface CollectElementOptions { From 05844d0bef53a262518446c908ae3a746cd9065f Mon Sep 17 00:00:00 2001 From: skyflow-bharti Date: Thu, 26 Mar 2026 05:23:55 +0000 Subject: [PATCH 4/4] [AUTOMATED] Release - 2.7.3-dev.3a4806e --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a5833ec5..1a334076 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "skyflow-js", "preferGlobal": true, "analyze": false, - "version": "2.7.3-dev.71ebd92", + "version": "2.7.3-dev.3a4806e", "author": "Skyflow", "description": "Skyflow JavaScript SDK", "homepage": "https://github.com/skyflowapi/skyflow-js",