@commercetools-uikit/calendar-utils 16.7.2 → 16.7.4
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.
|
@@ -8,6 +8,7 @@ var _Array$from = require('@babel/runtime-corejs3/core-js-stable/array/from');
|
|
|
8
8
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
9
9
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
10
10
|
var moment = require('moment');
|
|
11
|
+
var inRange = require('lodash/inRange');
|
|
11
12
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
12
13
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
13
14
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -50,6 +51,7 @@ var _Array$from__default = /*#__PURE__*/_interopDefault(_Array$from);
|
|
|
50
51
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
51
52
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
52
53
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
54
|
+
var inRange__default = /*#__PURE__*/_interopDefault(inRange);
|
|
53
55
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
54
56
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
55
57
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -78,9 +80,10 @@ const getPreviousDay = day => moment__default["default"](day).subtract(1, 'day')
|
|
|
78
80
|
const getPaddingDayCount = (day, locale) => {
|
|
79
81
|
const firstDayOfWeek = moment__default["default"].localeData(locale).firstDayOfWeek();
|
|
80
82
|
const firstDayOfMonth = moment__default["default"](day).startOf('month').day();
|
|
83
|
+
const paddingDayCount = (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
81
84
|
|
|
82
85
|
// ensure number is always positive
|
|
83
|
-
return (
|
|
86
|
+
return inRange__default["default"](paddingDayCount, 0, 6) ? paddingDayCount : 0;
|
|
84
87
|
};
|
|
85
88
|
const getWeekdayNames = locale => {
|
|
86
89
|
const weekDays = moment__default["default"].localeData(locale).weekdaysMin();
|
|
@@ -641,7 +644,7 @@ CalendarMenu.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
641
644
|
} : {};
|
|
642
645
|
|
|
643
646
|
// NOTE: This string will be replaced on build time with the package version.
|
|
644
|
-
var version = "16.7.
|
|
647
|
+
var version = "16.7.4";
|
|
645
648
|
|
|
646
649
|
exports.CalendarBody = CalendarBody$1;
|
|
647
650
|
exports.CalendarContent = CalendarContent$1;
|
|
@@ -8,6 +8,7 @@ var _Array$from = require('@babel/runtime-corejs3/core-js-stable/array/from');
|
|
|
8
8
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
9
9
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
10
10
|
var moment = require('moment');
|
|
11
|
+
var inRange = require('lodash/inRange');
|
|
11
12
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
12
13
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
13
14
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -50,6 +51,7 @@ var _Array$from__default = /*#__PURE__*/_interopDefault(_Array$from);
|
|
|
50
51
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
51
52
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
52
53
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
54
|
+
var inRange__default = /*#__PURE__*/_interopDefault(inRange);
|
|
53
55
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
54
56
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
55
57
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -77,9 +79,10 @@ const getPreviousDay = day => moment__default["default"](day).subtract(1, 'day')
|
|
|
77
79
|
const getPaddingDayCount = (day, locale) => {
|
|
78
80
|
const firstDayOfWeek = moment__default["default"].localeData(locale).firstDayOfWeek();
|
|
79
81
|
const firstDayOfMonth = moment__default["default"](day).startOf('month').day();
|
|
82
|
+
const paddingDayCount = (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
80
83
|
|
|
81
84
|
// ensure number is always positive
|
|
82
|
-
return (
|
|
85
|
+
return inRange__default["default"](paddingDayCount, 0, 6) ? paddingDayCount : 0;
|
|
83
86
|
};
|
|
84
87
|
const getWeekdayNames = locale => {
|
|
85
88
|
const weekDays = moment__default["default"].localeData(locale).weekdaysMin();
|
|
@@ -549,7 +552,7 @@ CalendarMenu.displayName = 'CalendarMenu';
|
|
|
549
552
|
CalendarMenu.propTypes = {};
|
|
550
553
|
|
|
551
554
|
// NOTE: This string will be replaced on build time with the package version.
|
|
552
|
-
var version = "16.7.
|
|
555
|
+
var version = "16.7.4";
|
|
553
556
|
|
|
554
557
|
exports.CalendarBody = CalendarBody$1;
|
|
555
558
|
exports.CalendarContent = CalendarContent$1;
|
|
@@ -4,6 +4,7 @@ import _Array$from from '@babel/runtime-corejs3/core-js-stable/array/from';
|
|
|
4
4
|
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
5
5
|
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
6
6
|
import moment from 'moment';
|
|
7
|
+
import inRange from 'lodash/inRange';
|
|
7
8
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
8
9
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
9
10
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -48,9 +49,10 @@ const getPreviousDay = day => moment(day).subtract(1, 'day').format('YYYY-MM-DD'
|
|
|
48
49
|
const getPaddingDayCount = (day, locale) => {
|
|
49
50
|
const firstDayOfWeek = moment.localeData(locale).firstDayOfWeek();
|
|
50
51
|
const firstDayOfMonth = moment(day).startOf('month').day();
|
|
52
|
+
const paddingDayCount = (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
51
53
|
|
|
52
54
|
// ensure number is always positive
|
|
53
|
-
return (
|
|
55
|
+
return inRange(paddingDayCount, 0, 6) ? paddingDayCount : 0;
|
|
54
56
|
};
|
|
55
57
|
const getWeekdayNames = locale => {
|
|
56
58
|
const weekDays = moment.localeData(locale).weekdaysMin();
|
|
@@ -611,6 +613,6 @@ CalendarMenu.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
611
613
|
} : {};
|
|
612
614
|
|
|
613
615
|
// NOTE: This string will be replaced on build time with the package version.
|
|
614
|
-
var version = "16.7.
|
|
616
|
+
var version = "16.7.4";
|
|
615
617
|
|
|
616
618
|
export { CalendarBody$1 as CalendarBody, CalendarContent$1 as CalendarContent, CalendarDay$1 as CalendarDay, CalendarHeader$1 as CalendarHeader, CalendarMenu, changeMonth, createCalendarItems, createItemRangeToString, createItemToString, formatDate, formatRange, getCalendarDayLabel, getDateInMonth, getDaysInMonth, getExampleDateStrings, getIsDateInRange, getMonthCalendarLabel, getNextDay, getPaddingDayCount, getPreviousDay, getToday, getWeekdayNames, getYearCalendarLabel, isBetween, isSameDay, parseInputToDate, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/calendar-utils",
|
|
3
3
|
"description": "Utilities to work with values for a calendar.",
|
|
4
|
-
"version": "16.7.
|
|
4
|
+
"version": "16.7.4",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,18 +21,19 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/accessible-button": "16.7.
|
|
25
|
-
"@commercetools-uikit/design-system": "16.7.
|
|
26
|
-
"@commercetools-uikit/hooks": "16.7.
|
|
27
|
-
"@commercetools-uikit/icons": "16.7.
|
|
28
|
-
"@commercetools-uikit/input-utils": "16.7.
|
|
29
|
-
"@commercetools-uikit/secondary-icon-button": "16.7.
|
|
30
|
-
"@commercetools-uikit/spacings-inline": "16.7.
|
|
31
|
-
"@commercetools-uikit/text": "16.7.
|
|
32
|
-
"@commercetools-uikit/tooltip": "16.7.
|
|
33
|
-
"@commercetools-uikit/utils": "16.7.
|
|
24
|
+
"@commercetools-uikit/accessible-button": "16.7.4",
|
|
25
|
+
"@commercetools-uikit/design-system": "16.7.4",
|
|
26
|
+
"@commercetools-uikit/hooks": "16.7.4",
|
|
27
|
+
"@commercetools-uikit/icons": "16.7.4",
|
|
28
|
+
"@commercetools-uikit/input-utils": "16.7.4",
|
|
29
|
+
"@commercetools-uikit/secondary-icon-button": "16.7.4",
|
|
30
|
+
"@commercetools-uikit/spacings-inline": "16.7.4",
|
|
31
|
+
"@commercetools-uikit/text": "16.7.4",
|
|
32
|
+
"@commercetools-uikit/tooltip": "16.7.4",
|
|
33
|
+
"@commercetools-uikit/utils": "16.7.4",
|
|
34
34
|
"@emotion/react": "^11.10.5",
|
|
35
35
|
"@emotion/styled": "^11.10.5",
|
|
36
|
+
"lodash": "4.17.21",
|
|
36
37
|
"prop-types": "15.8.1",
|
|
37
38
|
"react-select": "5.7.3"
|
|
38
39
|
},
|