lion/packages/ui/components/localize/src/date/utils/checkYearFormat.js
Sebastian Kamiński a181a035e9
fix: bug that accepted 3 digit year (#2489)
* fix: bug that accepted 3 digit year

* fix: bug that accepted 3 digit year

* Update packages/ui/components/localize/test/date/parseDate.test.js

---------

Co-authored-by: Thijs Louisse <t_louisse@hotmail.com>
2025-03-13 08:34:56 +01:00

8 lines
143 B
JavaScript

/**
*
* @param {string} year
* @returns {boolean}
*/
export function isCorrectYearFormat(year) {
return /^\d{2}(\d{2})?$/g.test(year);
}