Skip to content

Commit 45ebd8b

Browse files
committed
reword the jsdoc comment
1 parent 6985e4f commit 45ebd8b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ab-testing/config/scripts/validation/validExpiration.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ export function allExpirationsValid(tests: ABTest[]): boolean {
1414
}
1515

1616
/**
17-
* Check if the input date matches the JS interpreted date to check it is valid
18-
* If the input !== output date, we throw an error to highlight the date set is not
19-
* the actual expiration date of the test
17+
* Converts the expiration date to a `Date` object and then back into a string
18+
* This is to confirm Javascript interprets the input the same way humans do
19+
* If there's a difference, we throw an error to highlight the discrepancy
20+
* @example `2026-02-30` is interpreted as `2026-03-02` so this fails
21+
* @example `2026-01-30` is interpreted as `2026-01-30` so this passes
2022
*/
2123
const interpretedExpirationDate = new Date(test.expirationDate)
2224
.toISOString()

0 commit comments

Comments
 (0)