@synerise/ds-date-range-picker 1.3.9 → 1.3.11
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.
- package/CHANGELOG.md +976 -2643
- package/README.md +85 -86
- package/dist/AddonCollapse/AddonCollapse.d.ts +1 -1
- package/dist/AddonCollapse/AddonCollapse.types.d.ts +1 -1
- package/dist/DateRangePicker.d.ts +2 -2
- package/dist/DateRangePicker.js +8 -6
- package/dist/DateRangePicker.styles.d.ts +1 -1
- package/dist/DateRangePicker.types.d.ts +10 -11
- package/dist/DateRangePicker.types.js +1 -5
- package/dist/Footer/Footer.d.ts +1 -1
- package/dist/Footer/Footer.js +6 -6
- package/dist/RangeFilter/Filters/DailyFilter/DailyFilter.d.ts +7 -7
- package/dist/RangeFilter/Filters/DailyFilter/DailyFilter.js +2 -2
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.d.ts +1 -1
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.js +8 -10
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.styles.d.ts +1 -1
- package/dist/RangeFilter/Filters/MonthlyFilter/MonthlyFilter.types.d.ts +6 -6
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.d.ts +1 -1
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.js +1 -1
- package/dist/RangeFilter/Filters/WeeklyFilter/WeeklyFilter.types.d.ts +5 -5
- package/dist/RangeFilter/Filters/new/Daily/Daily.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/Daily/Daily.js +6 -8
- package/dist/RangeFilter/Filters/new/Daily/Daily.types.d.ts +6 -6
- package/dist/RangeFilter/Filters/new/Filters.types.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.js +9 -9
- package/dist/RangeFilter/Filters/new/Monthly/Monthly.types.d.ts +7 -7
- package/dist/RangeFilter/Filters/new/Monthly/utils.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.d.ts +1 -1
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.js +9 -9
- package/dist/RangeFilter/Filters/new/Weekly/Weekly.types.d.ts +6 -6
- package/dist/RangeFilter/Filters/new/Weekly/utils.d.ts +2 -2
- package/dist/RangeFilter/Filters/new/constants.js +0 -1
- package/dist/RangeFilter/Filters/new/hooks/useShiftAndControlKeys.js +1 -1
- package/dist/RangeFilter/RangeFilter.d.ts +1 -1
- package/dist/RangeFilter/RangeFilter.js +5 -5
- package/dist/RangeFilter/RangeFilter.types.d.ts +6 -6
- package/dist/RangeFilter/Shared/AddButton/AddButton.d.ts +1 -1
- package/dist/RangeFilter/Shared/AddButton/AddButton.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.d.ts +1 -1
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.js +3 -3
- package/dist/RangeFilter/Shared/FilterDropdown/FilterDropdown.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.d.ts +2 -2
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.js +2 -2
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.styles.d.ts +5 -3
- package/dist/RangeFilter/Shared/RangeFilterStatus/RangeFilterStatus.types.d.ts +3 -3
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.d.ts +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.js +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.styles.d.ts +1 -1
- package/dist/RangeFilter/Shared/SaveFilterForm/SaveFilterForm.types.d.ts +1 -1
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.d.ts +1 -1
- package/dist/RangeFilter/Shared/SelectionCount/SelectionCount.types.d.ts +1 -1
- package/dist/RangeFilter/Shared/SelectionHint/SelectionHint.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.js +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/Day/Day.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.js +16 -12
- package/dist/RangeFilter/Shared/TimeWindow/Grid/Grid.types.d.ts +3 -3
- package/dist/RangeFilter/Shared/TimeWindow/Header/Header.js +5 -9
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.js +3 -3
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.styles.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeActions/RangeActions.types.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.js +16 -12
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeForm/RangeForm.utils.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.js +7 -5
- package/dist/RangeFilter/Shared/TimeWindow/RangeFormContainer/RangeFormContainer.types.d.ts +10 -6
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.d.ts +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/RangeSummary/RangeSummary.types.d.ts +4 -4
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.js +27 -15
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.styles.js +1 -1
- package/dist/RangeFilter/Shared/TimeWindow/TimeWindow.types.d.ts +8 -8
- package/dist/RangeFilter/Shared/TimeWindow/utils.d.ts +2 -2
- package/dist/RangeFilter/Shared/TimeWindow/utils.js +1 -1
- package/dist/RangeFilter/constants.d.ts +1 -1
- package/dist/RangeFilter/constants.js +2 -2
- package/dist/RangeFilter/utils.d.ts +3 -3
- package/dist/RangeFilter/utils.js +44 -37
- package/dist/RangePicker/RangePicker.d.ts +1 -1
- package/dist/RangePicker/RangePicker.js +16 -14
- package/dist/RangePicker/RangePicker.styles.d.ts +1 -1
- package/dist/RangePicker/RangePicker.types.d.ts +3 -3
- package/dist/RangePicker/utils.d.ts +3 -3
- package/dist/RangePicker/utils.js +7 -7
- package/dist/RangePickerInput/RangePickerInput.d.ts +1 -1
- package/dist/RangePickerInput/RangePickerInput.js +4 -4
- package/dist/RangePickerInput/RangePickerInput.types.d.ts +2 -2
- package/dist/RawDateRangePicker.js +10 -10
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.js +4 -4
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/CustomRangeForm.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.js +5 -5
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/DurationField/DurationField.types.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.js +3 -3
- package/dist/RelativeRangePicker/Elements/CustomRangeForm/OffsetField/OffsetField.types.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.js +2 -2
- package/dist/RelativeRangePicker/Elements/ModeDropdown/ModeDropdown.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.js +2 -2
- package/dist/RelativeRangePicker/Elements/RangeButtons/RangeButtons.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.js +8 -6
- package/dist/RelativeRangePicker/Elements/RangeDropdown/RangeDropdown.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.js +4 -4
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.types.d.ts +2 -2
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.d.ts +1 -1
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.js +5 -4
- package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampRange.types.d.ts +2 -2
- package/dist/RelativeRangePicker/RelativeRangePicker.d.ts +1 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.js +14 -10
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.d.ts +1 -1
- package/dist/RelativeRangePicker/RelativeRangePicker.styles.js +8 -15
- package/dist/RelativeRangePicker/RelativeRangePicker.types.d.ts +3 -3
- package/dist/RelativeRangePicker/utils/findMatchingPreset.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/findMatchingPreset.utils.js +0 -1
- package/dist/RelativeRangePicker/utils/findRangeByKey.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/getCurrentGroupFromProps.utils.d.ts +3 -3
- package/dist/RelativeRangePicker/utils/getDefaultCustomRange.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/getDefaultCustomRange.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/isAbsolute.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/setDurationValue.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/setDurationValue.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/setFuture.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/setOffsetValue.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/setOffsetValue.utils.js +1 -1
- package/dist/RelativeRangePicker/utils/updatePresetKey.utils.d.ts +1 -1
- package/dist/RelativeRangePicker/utils/updatePresetKey.utils.js +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/date.types.d.ts +2 -2
- package/dist/dateUtils/add.d.ts +7 -7
- package/dist/dateUtils/add.js +7 -7
- package/dist/dateUtils/difference.d.ts +7 -7
- package/dist/dateUtils/difference.js +7 -7
- package/dist/dateUtils/endOf.d.ts +7 -7
- package/dist/dateUtils/endOf.js +7 -7
- package/dist/dateUtils/format.js +2 -2
- package/dist/dateUtils/get.d.ts +3 -3
- package/dist/dateUtils/get.js +3 -3
- package/dist/dateUtils/getRelativePresetForRange.d.ts +1 -1
- package/dist/dateUtils/getRelativePresetForRange.js +1 -1
- package/dist/dateUtils/relativeToAbsolute.d.ts +1 -1
- package/dist/dateUtils/relativeToAbsolute.js +1 -1
- package/dist/dateUtils/set.d.ts +3 -3
- package/dist/dateUtils/set.js +3 -3
- package/dist/dateUtils/startOf.d.ts +7 -7
- package/dist/dateUtils/startOf.js +7 -7
- package/dist/dateUtils/sub.d.ts +7 -7
- package/dist/dateUtils/sub.js +7 -7
- package/dist/fns.d.ts +20 -20
- package/dist/fns.js +20 -20
- package/dist/index.d.ts +2 -2
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +6 -4
- package/package.json +22 -22
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import lensPath from 'ramda/src/lensPath';
|
|
2
|
+
import set from 'ramda/src/set';
|
|
1
3
|
import React, { useEffect } from 'react';
|
|
2
|
-
import Select from '@synerise/ds-select';
|
|
3
4
|
import InputNumber from '@synerise/ds-input-number';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
5
|
+
import Select from '@synerise/ds-select';
|
|
6
|
+
import { RANGES_MODE, RELATIVE_DURATION_MAX, RELATIVE_UNITS } from '../../../../constants';
|
|
6
7
|
import * as S from '../../../RelativeRangePicker.styles';
|
|
7
|
-
import { RELATIVE_UNITS, RANGES_MODE, RELATIVE_DURATION_MAX } from '../../../../constants';
|
|
8
8
|
export var setDurationType = set(lensPath(['duration', 'type']));
|
|
9
9
|
var SELECT_DROPDOWN_OFFSET = -4;
|
|
10
10
|
var DurationField = function DurationField(_ref) {
|
|
@@ -44,7 +44,7 @@ var DurationField = function DurationField(_ref) {
|
|
|
44
44
|
offset: [0, SELECT_DROPDOWN_OFFSET]
|
|
45
45
|
},
|
|
46
46
|
getPopupContainer: function getPopupContainer(node) {
|
|
47
|
-
return node.parentElement
|
|
47
|
+
return node.parentElement !== null ? node.parentElement : document.body;
|
|
48
48
|
}
|
|
49
49
|
}, (rangeUnits || RELATIVE_UNITS).map(function (type) {
|
|
50
50
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Props } from './OffsetField.types';
|
|
2
|
+
import { type Props } from './OffsetField.types';
|
|
3
3
|
declare const OffsetField: ({ handleOffsetValueChange, currentGroup, handleChange, currentRange, texts, rangeUnits, }: Props) => React.JSX.Element;
|
|
4
4
|
export default OffsetField;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import Select from '@synerise/ds-select';
|
|
3
2
|
import InputNumber from '@synerise/ds-input-number';
|
|
3
|
+
import Select from '@synerise/ds-select';
|
|
4
|
+
import { RANGES_MODE, RELATIVE_OFFSET_MAX, RELATIVE_UNITS } from '../../../../constants';
|
|
4
5
|
import * as S from '../../../RelativeRangePicker.styles';
|
|
5
|
-
import { RELATIVE_UNITS, RANGES_MODE, RELATIVE_OFFSET_MAX } from '../../../../constants';
|
|
6
6
|
import { setOffsetType } from '../CustomRangeForm';
|
|
7
7
|
var SELECT_DROPDOWN_OFFSET = -4;
|
|
8
8
|
var OffsetField = function OffsetField(_ref) {
|
|
@@ -41,7 +41,7 @@ var OffsetField = function OffsetField(_ref) {
|
|
|
41
41
|
offset: [0, SELECT_DROPDOWN_OFFSET]
|
|
42
42
|
},
|
|
43
43
|
getPopupContainer: function getPopupContainer(node) {
|
|
44
|
-
return node.parentElement
|
|
44
|
+
return node.parentElement !== null ? node.parentElement : document.body;
|
|
45
45
|
}
|
|
46
46
|
}, (rangeUnits || RELATIVE_UNITS).map(function (type) {
|
|
47
47
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useRef, useState } from 'react';
|
|
2
|
-
import Icon, { CheckS } from '@synerise/ds-icon';
|
|
3
2
|
import { theme } from '@synerise/ds-core';
|
|
3
|
+
import Icon, { CheckS } from '@synerise/ds-icon';
|
|
4
4
|
import { useOnClickOutside } from '@synerise/ds-utils';
|
|
5
|
-
import * as S from '../../RelativeRangePicker.styles';
|
|
6
5
|
import { RANGES_ICON } from '../../../constants';
|
|
6
|
+
import * as S from '../../RelativeRangePicker.styles';
|
|
7
7
|
var MODE_TRANSLATION_KEYS = {
|
|
8
8
|
PAST: 'last',
|
|
9
9
|
FUTURE: 'next',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type RelativeMode, type Texts } from '../../../DateRangePicker.types';
|
|
2
|
+
import { type DateRange, type RelativeDateRange } from '../../../date.types';
|
|
3
3
|
export type Props = {
|
|
4
4
|
ranges?: DateRange[];
|
|
5
5
|
currentRange: RelativeDateRange;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { findMatchingPreset } from '../../../RelativeRangePicker/utils';
|
|
3
|
+
import { ALL_TIME } from '../../../constants';
|
|
2
4
|
import * as S from '../../RelativeRangePicker.styles';
|
|
3
5
|
import { isLifetime } from '../RangeDropdown/RangeDropdown';
|
|
4
|
-
import { ALL_TIME } from '../../../constants';
|
|
5
|
-
import { findMatchingPreset } from '../../utils';
|
|
6
6
|
var RangeButtons = function RangeButtons(_ref) {
|
|
7
7
|
var ranges = _ref.ranges,
|
|
8
8
|
currentRange = _ref.currentRange,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type Texts } from '../../../DateRangePicker.types';
|
|
2
|
+
import type { AbsoluteDateRange, DateRange, RelativeDateRange } from '../../../date.types';
|
|
3
3
|
export type Props = {
|
|
4
4
|
ranges: DateRange[];
|
|
5
5
|
currentRange: RelativeDateRange;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { type DateRange } from '../../../date.types';
|
|
3
|
+
import { type RangeDropdownProps } from './RangeDropdown.types';
|
|
4
4
|
/**
|
|
5
5
|
* Tell whether given date (range) is a lifetime value.
|
|
6
6
|
*
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React, { useCallback, useRef, useState } from 'react';
|
|
2
|
-
import find from 'ramda/src/find';
|
|
3
1
|
import { isEqual } from 'lodash';
|
|
2
|
+
import find from 'ramda/src/find';
|
|
3
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
4
|
+
import { theme } from '@synerise/ds-core';
|
|
4
5
|
import Icon, { AngleDownS, CheckS } from '@synerise/ds-icon';
|
|
5
|
-
import { useOnClickOutside } from '@synerise/ds-utils';
|
|
6
6
|
import Scrollbar from '@synerise/ds-scrollbar';
|
|
7
|
-
import {
|
|
8
|
-
import * as S from '../../RelativeRangePicker.styles';
|
|
7
|
+
import { useOnClickOutside } from '@synerise/ds-utils';
|
|
9
8
|
import { ALL_TIME } from '../../../constants';
|
|
9
|
+
import * as S from '../../RelativeRangePicker.styles';
|
|
10
10
|
import { findRangeByKey } from '../../utils';
|
|
11
11
|
var MAX_ITEMS_COUNT = 7;
|
|
12
12
|
var ITEMS_HEIGHT = 32;
|
|
@@ -54,7 +54,9 @@ var RangeDropdown = function RangeDropdown(_ref) {
|
|
|
54
54
|
onChange(range);
|
|
55
55
|
setDropVisible(false);
|
|
56
56
|
}, [onChange, ranges]);
|
|
57
|
-
if (!ranges || ranges.length === 0)
|
|
57
|
+
if (!ranges || ranges.length === 0) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
58
60
|
var mappedRanges = ranges.map(valueTransformer);
|
|
59
61
|
var transformedCurrentRange = valueTransformer(currentRange);
|
|
60
62
|
var anyOfTransformedRangesMatchesCurrentRange = isLifetime(transformedCurrentRange) ? false : find(function (r) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type DateRangePickerProps, type Texts } from '../../../DateRangePicker.types';
|
|
2
|
+
import { type DateRange } from '../../../date.types';
|
|
3
3
|
export type RangeDropdownProps = {
|
|
4
4
|
ranges: DateRange[];
|
|
5
5
|
currentRange: DateRange;
|
package/dist/RelativeRangePicker/Elements/TimestampRange/TimestampDuration/TimestampDuration.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Select from '@synerise/ds-select';
|
|
3
2
|
import InputNumber from '@synerise/ds-input-number';
|
|
4
|
-
import
|
|
3
|
+
import Select from '@synerise/ds-select';
|
|
5
4
|
import * as CONST from '../../../../constants';
|
|
6
5
|
import { DURATION_MODIFIERS } from '../../../../constants';
|
|
6
|
+
import * as S from '../../../RelativeRangePicker.styles';
|
|
7
7
|
var SELECT_DROPDOWN_OFFSET = -4;
|
|
8
8
|
var TimestampDuration = function TimestampDuration(_ref) {
|
|
9
9
|
var handleDurationValueChange = _ref.handleDurationValueChange,
|
|
@@ -30,7 +30,7 @@ var TimestampDuration = function TimestampDuration(_ref) {
|
|
|
30
30
|
offset: [0, SELECT_DROPDOWN_OFFSET]
|
|
31
31
|
},
|
|
32
32
|
getPopupContainer: function getPopupContainer(node) {
|
|
33
|
-
return node.parentElement
|
|
33
|
+
return node.parentElement !== null ? node.parentElement : document.body;
|
|
34
34
|
}
|
|
35
35
|
}, durationModiferValues.map(function (modifier) {
|
|
36
36
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
@@ -57,7 +57,7 @@ var TimestampDuration = function TimestampDuration(_ref) {
|
|
|
57
57
|
offset: [0, SELECT_DROPDOWN_OFFSET]
|
|
58
58
|
},
|
|
59
59
|
getPopupContainer: function getPopupContainer(node) {
|
|
60
|
-
return node.parentElement
|
|
60
|
+
return node.parentElement !== null ? node.parentElement : document.body;
|
|
61
61
|
}
|
|
62
62
|
}, CONST.RELATIVE_UNITS.map(function (type) {
|
|
63
63
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type Texts } from '../../../../DateRangePicker.types';
|
|
2
|
+
import { type RelativeDateRange } from '../../../../date.types';
|
|
3
3
|
export type Props = {
|
|
4
4
|
currentRange: RelativeDateRange;
|
|
5
5
|
handleDurationValueChange: (value?: string | number | null) => void;
|
|
@@ -4,10 +4,10 @@ import React from 'react';
|
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
5
|
import DatePicker from '@synerise/ds-date-picker/dist/DatePicker';
|
|
6
6
|
import { getDefaultTexts } from '@synerise/ds-date-picker/dist/utils/getDefaultTexts';
|
|
7
|
-
import * as S from '../../RelativeRangePicker.styles';
|
|
8
|
-
import TimestampDuration from './TimestampDuration/TimestampDuration';
|
|
9
7
|
import { CUSTOM_RANGE_KEY, DURATION_MODIFIERS } from '../../../constants';
|
|
10
8
|
import { DEFAULT_RANGE } from '../../../utils';
|
|
9
|
+
import * as S from '../../RelativeRangePicker.styles';
|
|
10
|
+
import TimestampDuration from './TimestampDuration/TimestampDuration';
|
|
11
11
|
var TimestampRange = function TimestampRange(_ref) {
|
|
12
12
|
var _currentRange$duratio, _currentRange$duratio2;
|
|
13
13
|
var currentRange = _ref.currentRange,
|
|
@@ -90,7 +90,7 @@ var TimestampRange = function TimestampRange(_ref) {
|
|
|
90
90
|
},
|
|
91
91
|
dropdownProps: {
|
|
92
92
|
getPopupContainer: function getPopupContainer(node) {
|
|
93
|
-
return node.parentElement
|
|
93
|
+
return node.parentElement !== null ? node.parentElement : document.body;
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
texts: {
|
|
@@ -122,4 +122,5 @@ var TimestampRange = function TimestampRange(_ref) {
|
|
|
122
122
|
texts: texts
|
|
123
123
|
}));
|
|
124
124
|
};
|
|
125
|
-
export default TimestampRange;
|
|
125
|
+
export default TimestampRange;
|
|
126
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type RelativeMode, type Texts } from '../../../DateRangePicker.types';
|
|
2
|
+
import { type RelativeDateRange } from '../../../date.types';
|
|
3
3
|
export type TimestampRangeProps = {
|
|
4
4
|
currentRange: RelativeDateRange;
|
|
5
5
|
handleChange: (value: RelativeDateRange) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WrappedComponentProps } from 'react-intl';
|
|
2
|
+
import { type WrappedComponentProps } from 'react-intl';
|
|
3
3
|
declare const _default: React.FC<import("react-intl").WithIntlProps<import("./RelativeRangePicker.types").RelativeRangePickerProps & WrappedComponentProps<"intl">>> & {
|
|
4
4
|
WrappedComponent: React.ComponentType<import("./RelativeRangePicker.types").RelativeRangePickerProps & WrappedComponentProps<"intl">>;
|
|
5
5
|
};
|
|
@@ -3,22 +3,22 @@ function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prot
|
|
|
3
3
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { injectIntl } from 'react-intl';
|
|
6
|
-
import * as S from './RelativeRangePicker.styles';
|
|
7
6
|
import * as CONST from '../constants';
|
|
7
|
+
import { CUSTOM_RANGE_KEY, RANGES_MODE } from '../constants';
|
|
8
8
|
import getRelativePresetForRange from '../dateUtils/getRelativePresetForRange';
|
|
9
|
-
import RangeButtons from './Elements/RangeButtons/RangeButtons';
|
|
10
|
-
import RangeDropdown from './Elements/RangeDropdown/RangeDropdown';
|
|
11
|
-
import CustomRangeForm from './Elements/CustomRangeForm/CustomRangeForm';
|
|
12
|
-
import { getCurrentGroupFromProps, getDefaultCustomRange, setFuture, setOffsetValue, setDurationValue, updatePresetKey, findMatchingPreset } from './utils';
|
|
13
9
|
import { fnsIsAfter } from '../fns';
|
|
14
10
|
import { DEFAULT_RANGE, normalizeRange } from '../utils';
|
|
15
|
-
import
|
|
11
|
+
import CustomRangeForm from './Elements/CustomRangeForm/CustomRangeForm';
|
|
12
|
+
import RangeButtons from './Elements/RangeButtons/RangeButtons';
|
|
13
|
+
import RangeDropdown from './Elements/RangeDropdown/RangeDropdown';
|
|
14
|
+
import * as S from './RelativeRangePicker.styles';
|
|
15
|
+
import { findMatchingPreset, getCurrentGroupFromProps, getDefaultCustomRange, setDurationValue, setFuture, setOffsetValue, updatePresetKey } from './utils';
|
|
16
16
|
var RelativeRangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
17
17
|
function RelativeRangePicker(props) {
|
|
18
18
|
var _this;
|
|
19
19
|
_this = _React$PureComponent.call(this, props) || this;
|
|
20
|
-
// @ts-
|
|
21
|
-
// eslint-disable-next-line
|
|
20
|
+
// @ts-expect-error - types mismatch
|
|
21
|
+
// eslint-disable-next-line react/state-in-constructor
|
|
22
22
|
_this.onModeChange = function (mode) {
|
|
23
23
|
var currentGroup = _this.state.currentGroup;
|
|
24
24
|
if (mode !== currentGroup) {
|
|
@@ -79,7 +79,9 @@ var RelativeRangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
79
79
|
onChange(resultRange);
|
|
80
80
|
};
|
|
81
81
|
_this.renderRanges = function (ranges) {
|
|
82
|
-
if (!ranges || ranges.length === 0)
|
|
82
|
+
if (!ranges || ranges.length === 0) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
83
85
|
var currentRange = _this.state.currentRange;
|
|
84
86
|
var _this$props = _this.props,
|
|
85
87
|
onChange = _this$props.onChange,
|
|
@@ -200,7 +202,9 @@ var RelativeRangePicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
200
202
|
var visibleRanges = orderedGroupedRanges ? orderedGroupedRanges.slice(0, 4) : [];
|
|
201
203
|
var hiddenRanges = orderedGroupedRanges ? orderedGroupedRanges.slice(4) : [];
|
|
202
204
|
var displayRangeForm = isCustomValue || currentRange && currentRange.type === CONST.RELATIVE;
|
|
203
|
-
if (!currentGroup)
|
|
205
|
+
if (!currentGroup) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
204
208
|
return /*#__PURE__*/React.createElement(S.Container, null, /*#__PURE__*/React.createElement(S.Ranges, null, showCustomRange && /*#__PURE__*/React.createElement(S.Range, {
|
|
205
209
|
"data-testid": "relative-range-preset-" + CUSTOM_RANGE_KEY,
|
|
206
210
|
key: CUSTOM_RANGE_KEY,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Props as InputGroupProps } from '@synerise/ds-input/dist/InputGroup.types';
|
|
2
|
+
import { type Props as InputGroupProps } from '@synerise/ds-input/dist/InputGroup.types';
|
|
3
3
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const Header: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
export declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -5,9 +5,10 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import Button, { ButtonToggle } from '@synerise/ds-button';
|
|
8
|
-
import ListItem from '@synerise/ds-list-item';
|
|
9
8
|
import { InputGroup } from '@synerise/ds-input';
|
|
10
9
|
import { InputGroupItem } from '@synerise/ds-input/dist/InputGroup.styles';
|
|
10
|
+
import ListItem from '@synerise/ds-list-item';
|
|
11
|
+
|
|
11
12
|
// import 'antd/lib/input/style/index.css' // this style might be in imported scopes as we use input; not needed here, but worth to mention this
|
|
12
13
|
|
|
13
14
|
export var Container = styled.div.withConfig({
|
|
@@ -43,13 +44,9 @@ export var InputSelectGroup = styled(InputGroup).withConfig({
|
|
|
43
44
|
export var ModeDropdownTrigger = styled(function (_ref) {
|
|
44
45
|
var children = _ref.children,
|
|
45
46
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
46
|
-
return (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
React.createElement(Button, _extends({
|
|
50
|
-
type: "tertiary"
|
|
51
|
-
}, rest), children)
|
|
52
|
-
);
|
|
47
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
48
|
+
type: "tertiary"
|
|
49
|
+
}, rest), children);
|
|
53
50
|
}).withConfig({
|
|
54
51
|
displayName: "RelativeRangePickerstyles__ModeDropdownTrigger",
|
|
55
52
|
componentId: "sc-17ul7sp-7"
|
|
@@ -57,13 +54,9 @@ export var ModeDropdownTrigger = styled(function (_ref) {
|
|
|
57
54
|
export var Range = styled(function (_ref2) {
|
|
58
55
|
var children = _ref2.children,
|
|
59
56
|
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
React.createElement(ButtonToggle, _extends({
|
|
64
|
-
type: "solid"
|
|
65
|
-
}, rest), children)
|
|
66
|
-
);
|
|
57
|
+
return /*#__PURE__*/React.createElement(ButtonToggle, _extends({
|
|
58
|
+
type: "solid"
|
|
59
|
+
}, rest), children);
|
|
67
60
|
}).withConfig({
|
|
68
61
|
displayName: "RelativeRangePickerstyles__Range",
|
|
69
62
|
componentId: "sc-17ul7sp-8"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IntlShape } from 'react-intl';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { type IntlShape } from 'react-intl';
|
|
2
|
+
import { type DateRangePickerProps, type RelativeMode, type Texts } from '../DateRangePicker.types';
|
|
3
|
+
import type { DateRange, DateRangePreset, RelativeDateRange } from '../date.types';
|
|
4
4
|
export type RelativeRangePickerProps = {
|
|
5
5
|
ranges?: DateRangePreset[];
|
|
6
6
|
value: DateRange;
|
|
@@ -8,6 +8,5 @@ export var findMatchingPreset = function findMatchingPreset(range) {
|
|
|
8
8
|
var _preset$offset, _range$offset, _preset$offset2, _range$offset2, _preset$duration, _range$duration, _preset$duration2, _range$duration2;
|
|
9
9
|
return Boolean(preset.future) === Boolean(range.future) && ((_preset$offset = preset.offset) == null ? void 0 : _preset$offset.type) === ((_range$offset = range.offset) == null ? void 0 : _range$offset.type) && ((_preset$offset2 = preset.offset) == null ? void 0 : _preset$offset2.value) === ((_range$offset2 = range.offset) == null ? void 0 : _range$offset2.value) && ((_preset$duration = preset.duration) == null ? void 0 : _preset$duration.type) === ((_range$duration = range.duration) == null ? void 0 : _range$duration.type) && ((_preset$duration2 = preset.duration) == null ? void 0 : _preset$duration2.value) === ((_range$duration2 = range.duration) == null ? void 0 : _range$duration2.value);
|
|
10
10
|
});
|
|
11
|
-
// eslint-disable-next-line consistent-return
|
|
12
11
|
return matchingPreset && _extends({}, matchingPreset);
|
|
13
12
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DateRange } from '../../date.types';
|
|
1
|
+
import { type DateRange } from '../../date.types';
|
|
2
2
|
export declare const findRangeByKey: (ranges: DateRange[], key: string) => DateRange | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare function getCurrentGroupFromProps({ relativeModes }: RelativeRangePickerProps): RelativeMode | null;
|
|
1
|
+
import { type RelativeMode } from '../../DateRangePicker.types';
|
|
2
|
+
import { type RelativeRangePickerProps } from '../RelativeRangePicker.types';
|
|
3
|
+
export declare function getCurrentGroupFromProps({ relativeModes, }: RelativeRangePickerProps): RelativeMode | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RelativeDateRange } from '../../date.types';
|
|
1
|
+
import { type RelativeDateRange } from '../../date.types';
|
|
2
2
|
export declare const getDefaultCustomRange: (currentGroup: string | null) => RelativeDateRange;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DateRange } from '../../date.types';
|
|
1
|
+
import { type DateRange } from '../../date.types';
|
|
2
2
|
export declare const isAbsolute: (value: DateRange) => boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RelativeDateRange } from '../../date.types';
|
|
1
|
+
import { type RelativeDateRange } from '../../date.types';
|
|
2
2
|
export declare const setDurationValue: (value: number | string, currentRange: RelativeDateRange) => RelativeDateRange;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import set from 'ramda/src/set';
|
|
2
1
|
import lensPath from 'ramda/src/lensPath';
|
|
2
|
+
import set from 'ramda/src/set';
|
|
3
3
|
export var setDurationValue = function setDurationValue(value, currentRange) {
|
|
4
4
|
var updatedValue = value === '' ? null : value;
|
|
5
5
|
return set(lensPath(['duration', 'value']))(typeof updatedValue === 'number' && updatedValue >= 1 ? Math.round(updatedValue) : 1, currentRange);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RelativeDateRange } from '../../date.types';
|
|
1
|
+
import { type RelativeDateRange } from '../../date.types';
|
|
2
2
|
export declare const setOffsetValue: (value: number | string, currentRange: RelativeDateRange) => RelativeDateRange;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import set from 'ramda/src/set';
|
|
2
1
|
import lensPath from 'ramda/src/lensPath';
|
|
2
|
+
import set from 'ramda/src/set';
|
|
3
3
|
export var setOffsetValue = function setOffsetValue(value, currentRange) {
|
|
4
4
|
var updatedValue = value === '' ? null : value;
|
|
5
5
|
return set(lensPath(['offset', 'value']))(typeof updatedValue === 'number' && updatedValue >= 0 ? Math.round(updatedValue) : 0, currentRange);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RelativeDateRange } from '../../date.types';
|
|
1
|
+
import { type RelativeDateRange } from '../../date.types';
|
|
2
2
|
export declare const updatePresetKey: (range: RelativeDateRange) => RelativeDateRange;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import { findMatchingPreset } from './findMatchingPreset.utils';
|
|
3
2
|
import { CUSTOM_RANGE_KEY } from '../../constants';
|
|
3
|
+
import { findMatchingPreset } from './findMatchingPreset.utils';
|
|
4
4
|
export var updatePresetKey = function updatePresetKey(range) {
|
|
5
5
|
var matchingPreset = findMatchingPreset(range);
|
|
6
6
|
if (matchingPreset && matchingPreset.key) {
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type AbsoluteDateRangePreset, type RangeKey, type RelativeDateRangePreset, type RelativeUnits } from './date.types';
|
|
3
3
|
export declare const SECONDS = "SECONDS";
|
|
4
4
|
export declare const MINUTES = "MINUTES";
|
|
5
5
|
export declare const HOURS = "HOURS";
|
package/dist/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ArrowLeftM, ArrowRightM, SinceArrowRightM } from '@synerise/ds-icon';
|
|
3
3
|
export var SECONDS = 'SECONDS';
|
|
4
4
|
export var MINUTES = 'MINUTES';
|
|
5
5
|
export var HOURS = 'HOURS';
|
package/dist/date.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type startOf from './dateUtils/startOf';
|
|
1
|
+
import type React from 'react';
|
|
3
2
|
import type endOf from './dateUtils/endOf';
|
|
3
|
+
import type startOf from './dateUtils/startOf';
|
|
4
4
|
export type RelativeUnits = 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS' | 'SINCE' | keyof typeof startOf | keyof typeof endOf;
|
|
5
5
|
export type RangeKey = 'TODAY' | 'YESTERDAY' | 'TOMORROW' | 'LAST_WEEK' | 'THIS_WEEK' | 'NEXT_WEEK' | 'LAST_7_DAYS' | 'NEXT_7_DAYS' | 'LAST_MONTH' | 'THIS_MONTH' | 'NEXT_MONTH' | 'LAST_3_MONTHS' | 'NEXT_3_MONTHS' | 'LAST_6_MONTHS' | 'NEXT_6_MONTHS' | 'LAST_YEAR' | 'NEXT_YEAR' | 'ALL_TIME';
|
|
6
6
|
export type NullableDateLimit = null | string | Date;
|
package/dist/dateUtils/add.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import fnsAddYears from
|
|
1
|
+
import fnsAddDays from 'date-fns/addDays';
|
|
2
|
+
import fnsAddHours from 'date-fns/addHours';
|
|
3
|
+
import fnsAddMinutes from 'date-fns/addMinutes';
|
|
4
|
+
import fnsAddMonths from 'date-fns/addMonths';
|
|
5
|
+
import fnsAddSeconds from 'date-fns/addSeconds';
|
|
6
|
+
import fnsAddWeeks from 'date-fns/addWeeks';
|
|
7
|
+
import fnsAddYears from 'date-fns/addYears';
|
|
8
8
|
declare const _default: {
|
|
9
9
|
HOURS: typeof fnsAddHours;
|
|
10
10
|
MINUTES: typeof fnsAddMinutes;
|
package/dist/dateUtils/add.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import fnsAddYears from
|
|
1
|
+
import fnsAddDays from 'date-fns/addDays';
|
|
2
|
+
import fnsAddHours from 'date-fns/addHours';
|
|
3
|
+
import fnsAddMinutes from 'date-fns/addMinutes';
|
|
4
|
+
import fnsAddMonths from 'date-fns/addMonths';
|
|
5
|
+
import fnsAddSeconds from 'date-fns/addSeconds';
|
|
6
|
+
import fnsAddWeeks from 'date-fns/addWeeks';
|
|
7
|
+
import fnsAddYears from 'date-fns/addYears';
|
|
8
8
|
export default {
|
|
9
9
|
HOURS: fnsAddHours,
|
|
10
10
|
MINUTES: fnsAddMinutes,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import differenceInYears from
|
|
1
|
+
import differenceInDays from 'date-fns/differenceInDays';
|
|
2
|
+
import differenceInHours from 'date-fns/differenceInHours';
|
|
3
|
+
import differenceInMinutes from 'date-fns/differenceInMinutes';
|
|
4
|
+
import differenceInMonths from 'date-fns/differenceInMonths';
|
|
5
|
+
import differenceInSeconds from 'date-fns/differenceInSeconds';
|
|
6
|
+
import differenceInWeeks from 'date-fns/differenceInWeeks';
|
|
7
|
+
import differenceInYears from 'date-fns/differenceInYears';
|
|
8
8
|
declare const _default: {
|
|
9
9
|
HOURS: typeof differenceInHours;
|
|
10
10
|
MINUTES: typeof differenceInMinutes;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import differenceInYears from
|
|
1
|
+
import differenceInDays from 'date-fns/differenceInDays';
|
|
2
|
+
import differenceInHours from 'date-fns/differenceInHours';
|
|
3
|
+
import differenceInMinutes from 'date-fns/differenceInMinutes';
|
|
4
|
+
import differenceInMonths from 'date-fns/differenceInMonths';
|
|
5
|
+
import differenceInSeconds from 'date-fns/differenceInSeconds';
|
|
6
|
+
import differenceInWeeks from 'date-fns/differenceInWeeks';
|
|
7
|
+
import differenceInYears from 'date-fns/differenceInYears';
|
|
8
8
|
export default {
|
|
9
9
|
HOURS: differenceInHours,
|
|
10
10
|
MINUTES: differenceInMinutes,
|