@astral/ui 1.0.0-test.1671106276 → 1.0.0-test.1671108572

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,7 +81,7 @@ const useDaysGrid = ({ baseDate, selectedDate, fullSize = false, isMondayFirst =
81
81
  }
82
82
  grid.push({
83
83
  isOutOfAvailableRange: dateMonth !== month,
84
- selected: !!selectedDate && (0, compareDateDayByUTC_1.compareDateDayByUTC)(selectedDate, date),
84
+ selected: (0, date_1.isDate)(selectedDate) && (0, compareDateDayByUTC_1.compareDateDayByUTC)(selectedDate, date),
85
85
  isCurrent: date.getUTCFullYear() === currentDate.getFullYear() &&
86
86
  date.getUTCDate() === currentDate.getDate() &&
87
87
  date.getUTCMonth() === currentDate.getMonth(),
@@ -1,6 +1,6 @@
1
1
  import { useContext, useMemo } from 'react';
2
2
  import { DAYS_IN_WEEK, MONTHS_IN_YEAR } from '../../../constants/counts';
3
- import { DateCompareDeep, addDays, buildIsoDate, isDateOutOfRange, } from '../../../../utils/date';
3
+ import { DateCompareDeep, addDays, buildIsoDate, isDate, isDateOutOfRange, } from '../../../../utils/date';
4
4
  import { buildGridResult } from '../../../utils/buildGridItem';
5
5
  import { MinMaxDateContext } from '../../../MinMaxDateContext';
6
6
  import { compareDateDayByUTC } from '../../../utils/compareDateDayByUTC';
@@ -78,7 +78,7 @@ export const useDaysGrid = ({ baseDate, selectedDate, fullSize = false, isMonday
78
78
  }
79
79
  grid.push({
80
80
  isOutOfAvailableRange: dateMonth !== month,
81
- selected: !!selectedDate && compareDateDayByUTC(selectedDate, date),
81
+ selected: isDate(selectedDate) && compareDateDayByUTC(selectedDate, date),
82
82
  isCurrent: date.getUTCFullYear() === currentDate.getFullYear() &&
83
83
  date.getUTCDate() === currentDate.getDate() &&
84
84
  date.getUTCMonth() === currentDate.getMonth(),
@@ -2,4 +2,4 @@ import dayjs from 'dayjs';
2
2
  /**
3
3
  * @description функция проверки значения на дату
4
4
  */
5
- export const isDate = (value) => dayjs(value).isValid();
5
+ export const isDate = (value) => Boolean(value) && dayjs(value).isValid();
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "1.0.0-test.1671106276",
3
+ "version": "1.0.0-test.1671108572",
4
4
  "browser": "./esm/index.js",
5
5
  "main": "./index.js",
6
6
  "dependencies": {
7
- "@astral/icons": "^1.0.0-test.1671106276",
7
+ "@astral/icons": "^1.0.0-test.1671108572",
8
8
  "@emotion/cache": "11.7.1",
9
9
  "@emotion/react": "11.9.0",
10
10
  "@emotion/server": "11.4.0",
@@ -8,5 +8,5 @@ const dayjs_1 = __importDefault(require("dayjs"));
8
8
  /**
9
9
  * @description функция проверки значения на дату
10
10
  */
11
- const isDate = (value) => (0, dayjs_1.default)(value).isValid();
11
+ const isDate = (value) => Boolean(value) && (0, dayjs_1.default)(value).isValid();
12
12
  exports.isDate = isDate;