@qrvey/utils 1.9.0 → 1.10.0-timezone-0
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/dist/charts/interfaces/IAggregateAbbreviation.d.ts +1 -1
- package/dist/charts/interfaces/IAggregateLabel.d.ts +1 -1
- package/dist/charts/interfaces/IAggregateType.d.ts +1 -1
- package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +12 -12
- package/dist/cjs/charts/interfaces/IAggregateAbbreviation.d.ts +1 -1
- package/dist/cjs/charts/interfaces/IAggregateLabel.d.ts +1 -1
- package/dist/cjs/charts/interfaces/IAggregateType.d.ts +1 -1
- package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +12 -12
- package/dist/cjs/column_format/interfaces/IChartGroupType.d.ts +1 -1
- package/dist/cjs/column_format/interfaces/IChartShelfType.d.ts +1 -1
- package/dist/cjs/column_format/interfaces/IChartTableType.d.ts +1 -1
- package/dist/cjs/column_format/interfaces/IColumnFormatReturnType.d.ts +1 -1
- package/dist/cjs/column_format/interfaces/IFormatStringType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IColumnImageUploadOption.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IColumnPropertyType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IColumnType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IComplexColumnPropertyType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IComplexColumnType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/ICompoundColumnPropertyType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/ICompoundColumnType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/IDateColumnPropertyType.d.ts +1 -1
- package/dist/cjs/columns/interfaces/INumericalColumnType.d.ts +1 -1
- package/dist/cjs/dates/adapters/ISOToNumericOffset.d.ts +6 -0
- package/dist/cjs/dates/adapters/ISOToNumericOffset.js +19 -0
- package/dist/cjs/dates/adapters/index.d.ts +2 -0
- package/dist/cjs/dates/adapters/index.js +2 -0
- package/dist/cjs/dates/adapters/numericOffsetToISO.d.ts +6 -0
- package/dist/cjs/dates/adapters/numericOffsetToISO.js +27 -0
- package/dist/cjs/dates/constants/ISO_8601_REGEX.d.ts +1 -0
- package/dist/cjs/dates/constants/ISO_8601_REGEX.js +4 -0
- package/dist/cjs/dates/constants/index.d.ts +1 -0
- package/dist/cjs/dates/constants/index.js +1 -0
- package/dist/cjs/dates/helpers/getDateByTimezoneOffset.d.ts +7 -0
- package/dist/cjs/dates/helpers/getDateByTimezoneOffset.js +25 -0
- package/dist/cjs/dates/helpers/index.d.ts +1 -1
- package/dist/cjs/dates/helpers/index.js +1 -1
- package/dist/cjs/dates/helpers/isValidISOOffset.d.ts +7 -0
- package/dist/cjs/dates/helpers/isValidISOOffset.js +17 -0
- package/dist/cjs/dates/interfaces/IDTimezoneOffset.d.ts +1 -0
- package/dist/cjs/dates/interfaces/IDTimezoneOffset.js +2 -0
- package/dist/cjs/dates/interfaces/IDateFormat.d.ts +1 -1
- package/dist/cjs/dates/interfaces/IDateGroupingProperty.d.ts +1 -1
- package/dist/cjs/dates/interfaces/index.d.ts +1 -0
- package/dist/cjs/dates/interfaces/index.js +1 -0
- package/dist/cjs/dates/relative/helpers/parseDate.d.ts +2 -2
- package/dist/cjs/dates/relative/interfaces/IRelativeUnit.d.ts +1 -1
- package/dist/cjs/dates/relative/interfaces/RelativeCursor.d.ts +1 -1
- package/dist/cjs/dates/relative/interfaces/RelativeInput.d.ts +1 -1
- package/dist/cjs/dates/relative/interfaces/ui/IRelativeSectionMode.d.ts +1 -1
- package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
- package/dist/cjs/filters/helpers/common/excludeFiltersByParams.js +5 -5
- package/dist/cjs/filters/helpers/common/index.d.ts +1 -0
- package/dist/cjs/filters/helpers/common/index.js +1 -0
- package/dist/cjs/filters/helpers/common/setTimezoneToFilters.d.ts +4 -0
- package/dist/cjs/filters/helpers/common/setTimezoneToFilters.js +17 -0
- package/dist/cjs/filters/interfaces/IFDateProperty.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFDateSection.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFOperator.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFProperty.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFScope.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFSection.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFStructureType.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFValidator.d.ts +1 -1
- package/dist/cjs/filters/interfaces/IFValue.d.ts +1 -1
- package/dist/cjs/filters/interfaces/OLD_IFilterExpression.d.ts +2 -2
- package/dist/cjs/filters/interfaces/backend/IFBExpressionRelativeDate.d.ts +1 -1
- package/dist/cjs/filters/interfaces/backend/IFBExpressionValue.d.ts +1 -1
- package/dist/cjs/filters/interfaces/backend/IFBackendExpressionValue.d.ts +1 -1
- package/dist/cjs/filters/interfaces/backend/IFBackendValidator.d.ts +1 -1
- package/dist/cjs/filters/interfaces/common/IFSColumn.d.ts +1 -1
- package/dist/cjs/filters/interfaces/common/IFSGetDataValues.d.ts +1 -1
- package/dist/cjs/filters/interfaces/common/IFSValueRelativeDate.d.ts +1 -1
- package/dist/cjs/filters/interfaces/common/IFilterConfig.d.ts +1 -1
- package/dist/cjs/filters/interfaces/panel/IFPAction.d.ts +1 -1
- package/dist/cjs/filters/interfaces/settings/IFSettingsPanelView.d.ts +1 -1
- package/dist/cjs/filters/interfaces/settings/IFSettingsScopes.d.ts +1 -1
- package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +2 -0
- package/dist/cjs/filters/services/Filters.api.js +1 -1
- package/dist/cjs/format/duration/durationFormatter.js +2 -1
- package/dist/cjs/formulas/interfaces/IFormulaType.d.ts +1 -1
- package/dist/cjs/general/array/addPropertyToArrayOfObjects.d.ts +1 -1
- package/dist/cjs/general/index.d.ts +1 -0
- package/dist/cjs/general/index.js +1 -0
- package/dist/cjs/general/mix/importScripts.d.ts +2 -2
- package/dist/cjs/general/numeric/getSign.d.ts +6 -0
- package/dist/cjs/general/numeric/getSign.js +12 -0
- package/dist/cjs/general/numeric/index.d.ts +1 -0
- package/dist/cjs/general/numeric/index.js +17 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_OPERATORS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_THRESHOLD.d.ts +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_TIME_PERIOD.d.ts +1 -1
- package/dist/cjs/interfaces/Chart.Interface.d.ts +1 -1
- package/dist/cjs/interfaces/IChartBuilder.Interface.d.ts +1 -1
- package/dist/cjs/interfaces/Qrvey.Interface.d.ts +2 -2
- package/dist/cjs/interfaces/general/IWidgetConfig.d.ts +2 -1
- package/dist/cjs/qrvey/helpers/transformValue.js +24 -1
- package/dist/cjs/qrvey/interfaces/IAppStatus.d.ts +1 -1
- package/dist/cjs/qrvey/interfaces/IAppType.d.ts +1 -1
- package/dist/cjs/qrvey/interfaces/IBDataset.d.ts +2 -0
- package/dist/cjs/qrvey/interfaces/IBTimezone.d.ts +4 -0
- package/dist/cjs/qrvey/interfaces/IBTimezone.js +2 -0
- package/dist/cjs/qrvey/interfaces/ICalculation.d.ts +1 -1
- package/dist/cjs/qrvey/interfaces/ICalculationType.d.ts +1 -1
- package/dist/cjs/qrvey/interfaces/IDataset.d.ts +3 -1
- package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +2 -0
- package/dist/cjs/qrvey/interfaces/index.d.ts +1 -0
- package/dist/cjs/qrvey/interfaces/index.js +1 -0
- package/dist/cjs/services/adapters/BDatasetsToUIDatasets.adapter.js +9 -5
- package/dist/cjs/services/helpers/Request.d.ts +1 -1
- package/dist/cjs/services/helpers/Request.js +6 -5
- package/dist/cjs/typescript/DeepPartial.d.ts +1 -1
- package/dist/cjs/typescript/DeepRequired.d.ts +1 -1
- package/dist/cjs/typescript/ValueOf.d.ts +1 -1
- package/dist/column_format/interfaces/IChartGroupType.d.ts +1 -1
- package/dist/column_format/interfaces/IChartShelfType.d.ts +1 -1
- package/dist/column_format/interfaces/IChartTableType.d.ts +1 -1
- package/dist/column_format/interfaces/IColumnFormatReturnType.d.ts +1 -1
- package/dist/column_format/interfaces/IFormatStringType.d.ts +1 -1
- package/dist/columns/interfaces/IColumnImageUploadOption.d.ts +1 -1
- package/dist/columns/interfaces/IColumnPropertyType.d.ts +1 -1
- package/dist/columns/interfaces/IColumnType.d.ts +1 -1
- package/dist/columns/interfaces/IComplexColumnPropertyType.d.ts +1 -1
- package/dist/columns/interfaces/IComplexColumnType.d.ts +1 -1
- package/dist/columns/interfaces/ICompoundColumnPropertyType.d.ts +1 -1
- package/dist/columns/interfaces/ICompoundColumnType.d.ts +1 -1
- package/dist/columns/interfaces/IDateColumnPropertyType.d.ts +1 -1
- package/dist/columns/interfaces/INumericalColumnType.d.ts +1 -1
- package/dist/dates/adapters/ISOToNumericOffset.d.ts +6 -0
- package/dist/dates/adapters/ISOToNumericOffset.js +15 -0
- package/dist/dates/adapters/index.d.ts +2 -0
- package/dist/dates/adapters/index.js +2 -0
- package/dist/dates/adapters/numericOffsetToISO.d.ts +6 -0
- package/dist/dates/adapters/numericOffsetToISO.js +23 -0
- package/dist/dates/constants/ISO_8601_REGEX.d.ts +1 -0
- package/dist/dates/constants/ISO_8601_REGEX.js +1 -0
- package/dist/dates/constants/index.d.ts +1 -0
- package/dist/dates/constants/index.js +1 -0
- package/dist/dates/helpers/getDateByTimezoneOffset.d.ts +7 -0
- package/dist/dates/helpers/getDateByTimezoneOffset.js +21 -0
- package/dist/dates/helpers/index.d.ts +1 -1
- package/dist/dates/helpers/index.js +1 -1
- package/dist/dates/helpers/isValidISOOffset.d.ts +7 -0
- package/dist/dates/helpers/isValidISOOffset.js +13 -0
- package/dist/dates/interfaces/IDTimezoneOffset.d.ts +1 -0
- package/dist/dates/interfaces/IDTimezoneOffset.js +1 -0
- package/dist/dates/interfaces/IDateFormat.d.ts +1 -1
- package/dist/dates/interfaces/IDateGroupingProperty.d.ts +1 -1
- package/dist/dates/interfaces/index.d.ts +1 -0
- package/dist/dates/interfaces/index.js +1 -0
- package/dist/dates/relative/helpers/parseDate.d.ts +2 -2
- package/dist/dates/relative/interfaces/IRelativeUnit.d.ts +1 -1
- package/dist/dates/relative/interfaces/RelativeCursor.d.ts +1 -1
- package/dist/dates/relative/interfaces/RelativeInput.d.ts +1 -1
- package/dist/dates/relative/interfaces/ui/IRelativeSectionMode.d.ts +1 -1
- package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
- package/dist/filters/helpers/common/excludeFiltersByParams.js +5 -5
- package/dist/filters/helpers/common/index.d.ts +1 -0
- package/dist/filters/helpers/common/index.js +1 -0
- package/dist/filters/helpers/common/setTimezoneToFilters.d.ts +4 -0
- package/dist/filters/helpers/common/setTimezoneToFilters.js +13 -0
- package/dist/filters/interfaces/IFDateProperty.d.ts +1 -1
- package/dist/filters/interfaces/IFDateSection.d.ts +1 -1
- package/dist/filters/interfaces/IFOperator.d.ts +1 -1
- package/dist/filters/interfaces/IFProperty.d.ts +1 -1
- package/dist/filters/interfaces/IFScope.d.ts +1 -1
- package/dist/filters/interfaces/IFSection.d.ts +1 -1
- package/dist/filters/interfaces/IFStructureType.d.ts +1 -1
- package/dist/filters/interfaces/IFValidator.d.ts +1 -1
- package/dist/filters/interfaces/IFValue.d.ts +1 -1
- package/dist/filters/interfaces/OLD_IFilterExpression.d.ts +2 -2
- package/dist/filters/interfaces/backend/IFBExpressionRelativeDate.d.ts +1 -1
- package/dist/filters/interfaces/backend/IFBExpressionValue.d.ts +1 -1
- package/dist/filters/interfaces/backend/IFBackendExpressionValue.d.ts +1 -1
- package/dist/filters/interfaces/backend/IFBackendValidator.d.ts +1 -1
- package/dist/filters/interfaces/common/IFSColumn.d.ts +1 -1
- package/dist/filters/interfaces/common/IFSGetDataValues.d.ts +1 -1
- package/dist/filters/interfaces/common/IFSValueRelativeDate.d.ts +1 -1
- package/dist/filters/interfaces/common/IFilterConfig.d.ts +1 -1
- package/dist/filters/interfaces/panel/IFPAction.d.ts +1 -1
- package/dist/filters/interfaces/settings/IFSettingsPanelView.d.ts +1 -1
- package/dist/filters/interfaces/settings/IFSettingsScopes.d.ts +1 -1
- package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +2 -0
- package/dist/filters/services/Filters.api.js +1 -1
- package/dist/format/duration/durationFormatter.js +2 -1
- package/dist/formulas/interfaces/IFormulaType.d.ts +1 -1
- package/dist/general/array/addPropertyToArrayOfObjects.d.ts +1 -1
- package/dist/general/index.d.ts +1 -0
- package/dist/general/index.js +1 -0
- package/dist/general/mix/importScripts.d.ts +2 -2
- package/dist/general/numeric/getSign.d.ts +6 -0
- package/dist/general/numeric/getSign.js +8 -0
- package/dist/general/numeric/index.d.ts +1 -0
- package/dist/general/numeric/index.js +1 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_OPERATORS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_THRESHOLD.d.ts +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_TIME_PERIOD.d.ts +1 -1
- package/dist/interfaces/Chart.Interface.d.ts +1 -1
- package/dist/interfaces/IChartBuilder.Interface.d.ts +1 -1
- package/dist/interfaces/Qrvey.Interface.d.ts +2 -2
- package/dist/interfaces/general/IWidgetConfig.d.ts +2 -1
- package/dist/qrvey/helpers/transformValue.js +24 -1
- package/dist/qrvey/interfaces/IAppStatus.d.ts +1 -1
- package/dist/qrvey/interfaces/IAppType.d.ts +1 -1
- package/dist/qrvey/interfaces/IBDataset.d.ts +2 -0
- package/dist/qrvey/interfaces/IBTimezone.d.ts +4 -0
- package/dist/qrvey/interfaces/IBTimezone.js +1 -0
- package/dist/qrvey/interfaces/ICalculation.d.ts +1 -1
- package/dist/qrvey/interfaces/ICalculationType.d.ts +1 -1
- package/dist/qrvey/interfaces/IDataset.d.ts +3 -1
- package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +2 -0
- package/dist/qrvey/interfaces/index.d.ts +1 -0
- package/dist/qrvey/interfaces/index.js +1 -0
- package/dist/services/adapters/BDatasetsToUIDatasets.adapter.js +9 -5
- package/dist/services/helpers/Request.d.ts +1 -1
- package/dist/services/helpers/Request.js +6 -5
- package/dist/typescript/DeepPartial.d.ts +1 -1
- package/dist/typescript/DeepRequired.d.ts +1 -1
- package/dist/typescript/ValueOf.d.ts +1 -1
- package/package.json +20 -19
- package/dist/cjs/dates/helpers/adjustTimezone.d.ts +0 -6
- package/dist/cjs/dates/helpers/adjustTimezone.js +0 -19
- package/dist/dates/helpers/adjustTimezone.d.ts +0 -6
- package/dist/dates/helpers/adjustTimezone.js +0 -15
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { STRING_FORMAT } from "../constants/STRING_FORMAT";
|
|
2
|
-
export
|
|
2
|
+
export type IFormatStringType = STRING_FORMAT;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { COLUMN_IMAGE_UPLOAD_OPTION } from "../constants/COLUMN_IMAGE_UPLOAD_OPTION";
|
|
2
|
-
export
|
|
2
|
+
export type IColumnImageUploadOption = COLUMN_IMAGE_UPLOAD_OPTION;
|
|
@@ -2,4 +2,4 @@ import { ICompoundColumnPropertyType } from "./ICompoundColumnPropertyType";
|
|
|
2
2
|
import { IDateColumnPropertyType } from "./IDateColumnPropertyType";
|
|
3
3
|
import { COLUMN_PROPERTY } from "../constants/COLUMN_PROPERTY";
|
|
4
4
|
import { IComplexColumnPropertyType } from "./IComplexColumnPropertyType";
|
|
5
|
-
export
|
|
5
|
+
export type IColumnPropertyType = COLUMN_PROPERTY | IComplexColumnPropertyType | ICompoundColumnPropertyType | IDateColumnPropertyType;
|
|
@@ -2,4 +2,4 @@ import { IComplexColumnType } from "./IComplexColumnType";
|
|
|
2
2
|
import { ICompoundColumnType } from "./ICompoundColumnType";
|
|
3
3
|
import { COLUMN } from "../constants/COLUMN";
|
|
4
4
|
import { INumericalColumnType } from "./INumericalColumnType";
|
|
5
|
-
export
|
|
5
|
+
export type IColumnType = COLUMN | ICompoundColumnType | IComplexColumnType | INumericalColumnType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { COMPLEX_COLUMN_PROPERTY } from "../constants/COMPLEX_COLUMN_PROPERTY";
|
|
2
|
-
export
|
|
2
|
+
export type IComplexColumnPropertyType = COMPLEX_COLUMN_PROPERTY;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { COMPLEX_COLUMN } from "../constants/COMPLEX_COLUMN";
|
|
2
|
-
export
|
|
2
|
+
export type IComplexColumnType = COMPLEX_COLUMN;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { COMPOUND_COLUMN_PROPERTY } from "../constants/COMPOUND_COLUMN_PROPERTY";
|
|
2
|
-
export
|
|
2
|
+
export type ICompoundColumnPropertyType = COMPOUND_COLUMN_PROPERTY;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { COMPOUND_COLUMN } from "../constants/COMPOUND_COLUMN";
|
|
2
|
-
export
|
|
2
|
+
export type ICompoundColumnType = COMPOUND_COLUMN;
|
|
@@ -2,4 +2,4 @@ import { DATE_GROUPING_TIME_PROPERTY } from "../../dates/constants/DATE_GROUPING
|
|
|
2
2
|
import { DATE_GROUPING_PROPERTY } from "../../dates/constants/DATE_GROUPING_PROPERTY";
|
|
3
3
|
import { DATE_DISTINCT_PROPERTY } from "../../dates/constants/DATE_DISTINCT_PROPERTY";
|
|
4
4
|
import { DATE_DISTINCT_TIME_PROPERTY } from "../../dates/constants/DATE_DISTINCT_TIME_PROPERTY";
|
|
5
|
-
export
|
|
5
|
+
export type IDateColumnPropertyType = DATE_GROUPING_PROPERTY | DATE_GROUPING_TIME_PROPERTY | DATE_DISTINCT_PROPERTY | DATE_DISTINCT_TIME_PROPERTY;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { NUMERICAL_COLUMN } from "../constants/NUMERICAL_COLUMN";
|
|
2
|
-
export
|
|
2
|
+
export type INumericalColumnType = NUMERICAL_COLUMN;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isNaNV2 } from "../../general/mix/isNaNV2";
|
|
2
|
+
import { isValidISOOffset } from "../helpers/isValidISOOffset";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the numeric offset (minutes) from the ISO offset (string)
|
|
5
|
+
* @param {string} offset the timezone offset
|
|
6
|
+
* @returns {number} the offset in minutes
|
|
7
|
+
*/
|
|
8
|
+
export function ISOToNumericOffset(offset) {
|
|
9
|
+
if (typeof offset === "number" || !isNaNV2(offset))
|
|
10
|
+
return +offset;
|
|
11
|
+
if (!isValidISOOffset(offset))
|
|
12
|
+
return 0;
|
|
13
|
+
const [hours, minutes] = offset.split(":").map(Number);
|
|
14
|
+
return hours * 60 + minutes;
|
|
15
|
+
}
|
|
@@ -5,8 +5,10 @@ export * from "./dateToQuarterYear";
|
|
|
5
5
|
export * from "./dateToWeekYear";
|
|
6
6
|
export * from "./dateToYear";
|
|
7
7
|
export * from "./hmsToDate";
|
|
8
|
+
export * from "./ISOToNumericOffset";
|
|
8
9
|
export * from "./mdyDateToDate";
|
|
9
10
|
export * from "./monthYearToDate";
|
|
11
|
+
export * from "./numericOffsetToISO";
|
|
10
12
|
export * from "./quarterYearToDate";
|
|
11
13
|
export * from "./weekYearToDate";
|
|
12
14
|
export * from "./yearToDate";
|
|
@@ -5,8 +5,10 @@ export * from "./dateToQuarterYear";
|
|
|
5
5
|
export * from "./dateToWeekYear";
|
|
6
6
|
export * from "./dateToYear";
|
|
7
7
|
export * from "./hmsToDate";
|
|
8
|
+
export * from "./ISOToNumericOffset";
|
|
8
9
|
export * from "./mdyDateToDate";
|
|
9
10
|
export * from "./monthYearToDate";
|
|
11
|
+
export * from "./numericOffsetToISO";
|
|
10
12
|
export * from "./quarterYearToDate";
|
|
11
13
|
export * from "./weekYearToDate";
|
|
12
14
|
export * from "./yearToDate";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isNaNV2 } from "../../general/mix/isNaNV2";
|
|
2
|
+
import { getSign } from "../../general/numeric/getSign";
|
|
3
|
+
import { padLeadingZeros } from "../../general/string/padLeadingZeros";
|
|
4
|
+
import { isValidISOOffset } from "../helpers/isValidISOOffset";
|
|
5
|
+
/**
|
|
6
|
+
* Gets the ISO offset From the numeric offset (minutes)
|
|
7
|
+
* @param {number} offset the timezone offset
|
|
8
|
+
* @returns {string} the offset in minutes
|
|
9
|
+
*/
|
|
10
|
+
export function numericOffsetToISO(offset) {
|
|
11
|
+
let newOffset = offset;
|
|
12
|
+
if (typeof offset === "string" && isValidISOOffset(offset))
|
|
13
|
+
return String(newOffset);
|
|
14
|
+
if (typeof offset !== "number" && isNaNV2(offset))
|
|
15
|
+
return "+00:00";
|
|
16
|
+
if (typeof offset === "string" && !isNaNV2(offset))
|
|
17
|
+
newOffset = +offset;
|
|
18
|
+
const sign = getSign(newOffset);
|
|
19
|
+
newOffset = Math.abs(newOffset);
|
|
20
|
+
const hours = padLeadingZeros(Math.floor(newOffset / 60), 2);
|
|
21
|
+
const minutes = padLeadingZeros(newOffset % 60, 2);
|
|
22
|
+
return `${sign}${hours}:${minutes}`;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ISO_8601_REGEX: RegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ISO_8601_REGEX = /^[+-]?\d{2}:\d{2}$/;
|
|
@@ -38,6 +38,7 @@ export * from "./DATE_YEAR_MONTHS_MMMM";
|
|
|
38
38
|
export * from "./DATE_YEAR_QUARTERS";
|
|
39
39
|
export * from "./DATE_YEAR_QUARTERS_RANGE";
|
|
40
40
|
export * from "./DATETIME_COLUMN_FORMAT";
|
|
41
|
+
export * from "./ISO_8601_REGEX";
|
|
41
42
|
export * from "./TIME_GROUPING_PROPERTY_INFO_LIST";
|
|
42
43
|
export * from "./TIME_GROUPING_PROPERTY_INFO";
|
|
43
44
|
export * from "./TIME_GROUPING_PROPERTY_LABEL";
|
|
@@ -38,6 +38,7 @@ export * from "./DATE_YEAR_MONTHS_MMMM";
|
|
|
38
38
|
export * from "./DATE_YEAR_QUARTERS";
|
|
39
39
|
export * from "./DATE_YEAR_QUARTERS_RANGE";
|
|
40
40
|
export * from "./DATETIME_COLUMN_FORMAT";
|
|
41
|
+
export * from "./ISO_8601_REGEX";
|
|
41
42
|
export * from "./TIME_GROUPING_PROPERTY_INFO_LIST";
|
|
42
43
|
export * from "./TIME_GROUPING_PROPERTY_INFO";
|
|
43
44
|
export * from "./TIME_GROUPING_PROPERTY_LABEL";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets a Date with the given offset of the Timezone.
|
|
3
|
+
* No given an offset the default is going to be set by the browser
|
|
4
|
+
* @param date String, object or millisencond number of the date
|
|
5
|
+
* @returns updated Date object
|
|
6
|
+
*/
|
|
7
|
+
export declare function getDateByTimezoneOffset(date: string | Date | number, offset?: number | string): Date;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isEmpty } from "../../general/mix/isEmpty";
|
|
2
|
+
import { ISOToNumericOffset } from "../adapters/ISOToNumericOffset";
|
|
3
|
+
import { DATE_FORMAT } from "../constants/DATE_FORMAT";
|
|
4
|
+
import { isValidPotentialDate } from "./isValidPotentialDate";
|
|
5
|
+
import { validateDate } from "./validateDate";
|
|
6
|
+
/**
|
|
7
|
+
* Gets a Date with the given offset of the Timezone.
|
|
8
|
+
* No given an offset the default is going to be set by the browser
|
|
9
|
+
* @param date String, object or millisencond number of the date
|
|
10
|
+
* @returns updated Date object
|
|
11
|
+
*/
|
|
12
|
+
export function getDateByTimezoneOffset(date, offset) {
|
|
13
|
+
if (!isValidPotentialDate(date) ||
|
|
14
|
+
(typeof date === "string" && !validateDate(date, DATE_FORMAT.DAY)))
|
|
15
|
+
return date;
|
|
16
|
+
const dt = new Date(date.valueOf());
|
|
17
|
+
const newOffset = isEmpty(offset) || offset === "browser"
|
|
18
|
+
? dt.getTimezoneOffset()
|
|
19
|
+
: ISOToNumericOffset(offset);
|
|
20
|
+
return new Date(+dt + newOffset * 1000 * 60);
|
|
21
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from "./adjustTimezone";
|
|
2
1
|
export * from "./areIncludedDateTokens";
|
|
3
2
|
export * from "./getDateByDateFormat";
|
|
4
3
|
export * from "./getDateFormatByProperty";
|
|
@@ -10,4 +9,5 @@ export * from "./getSeparatorByDateFormat";
|
|
|
10
9
|
export * from "./getWeek";
|
|
11
10
|
export * from "./isValidDateObject";
|
|
12
11
|
export * from "./isValidPotentialDate";
|
|
12
|
+
export * from "./getDateByTimezoneOffset";
|
|
13
13
|
export * from "./validateDate";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from "./adjustTimezone";
|
|
2
1
|
export * from "./areIncludedDateTokens";
|
|
3
2
|
export * from "./getDateByDateFormat";
|
|
4
3
|
export * from "./getDateFormatByProperty";
|
|
@@ -10,4 +9,5 @@ export * from "./getSeparatorByDateFormat";
|
|
|
10
9
|
export * from "./getWeek";
|
|
11
10
|
export * from "./isValidDateObject";
|
|
12
11
|
export * from "./isValidPotentialDate";
|
|
12
|
+
export * from "./getDateByTimezoneOffset";
|
|
13
13
|
export * from "./validateDate";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate if offset uses a valid ISO 8601 offset specification
|
|
3
|
+
* - If the given offset is a numeric, returns an invalid flag.
|
|
4
|
+
* @param {string} offset the timezone offset
|
|
5
|
+
* @returns {boolean} true if the given offset is valid
|
|
6
|
+
*/
|
|
7
|
+
export declare function isValidISOOffset(offset: number | string): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ISO_8601_REGEX } from "../constants/ISO_8601_REGEX";
|
|
2
|
+
/**
|
|
3
|
+
* Validate if offset uses a valid ISO 8601 offset specification
|
|
4
|
+
* - If the given offset is a numeric, returns an invalid flag.
|
|
5
|
+
* @param {string} offset the timezone offset
|
|
6
|
+
* @returns {boolean} true if the given offset is valid
|
|
7
|
+
*/
|
|
8
|
+
export function isValidISOOffset(offset) {
|
|
9
|
+
if (typeof offset !== "string")
|
|
10
|
+
return false;
|
|
11
|
+
const newOffset = (offset || "").trim();
|
|
12
|
+
return ISO_8601_REGEX.test(newOffset);
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type IDTimezoneOffset = number | string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DATE_FORMAT } from "../constants/DATE_FORMAT";
|
|
2
|
-
export
|
|
2
|
+
export type IDateFormat = (typeof DATE_FORMAT)[keyof typeof DATE_FORMAT];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DATE_GROUPING_PROPERTY } from "../constants/DATE_GROUPING_PROPERTY";
|
|
2
2
|
import { DATE_GROUPING_TIME_PROPERTY } from "../constants/DATE_GROUPING_TIME_PROPERTY";
|
|
3
|
-
export
|
|
3
|
+
export type IDateGroupingProperty = DATE_GROUPING_PROPERTY | DATE_GROUPING_TIME_PROPERTY;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dayjs } from "./dayjs-module";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type ParserDate = string | Dayjs | Date;
|
|
3
|
+
type ParserDateReturnType = Dayjs | null;
|
|
4
4
|
/**
|
|
5
5
|
* Parses a string date and returns a dayjs date
|
|
6
6
|
* @param {string|Dayjs|Date} date
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DATE_GROUPING_TIME_PROPERTY } from "../../constants/DATE_GROUPING_TIME_PROPERTY";
|
|
2
2
|
import { DATE_GROUPING_PROPERTY } from "../../constants/DATE_GROUPING_PROPERTY";
|
|
3
|
-
export
|
|
3
|
+
export type IRelativeUnit = keyof typeof DATE_GROUPING_PROPERTY | keyof typeof DATE_GROUPING_TIME_PROPERTY;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RELATIVE_CURSOR } from "../constants/RELATIVE_CURSOR";
|
|
2
|
-
export
|
|
2
|
+
export type RelativeCursor = RELATIVE_CURSOR;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RelativeStatement } from "./RelativeStatement";
|
|
2
|
-
export
|
|
2
|
+
export type RelativeInput = RelativeStatement | string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RELATIVE_MODE } from "../../constants/ui/RELATIVE_MODE";
|
|
2
|
-
export
|
|
2
|
+
export type IRelativeSectionMode = RELATIVE_MODE;
|
|
@@ -11,7 +11,7 @@ export function getFilterBuilderGeneralConfig(config = {}) {
|
|
|
11
11
|
domain: config.domain,
|
|
12
12
|
i18n: config.i18n,
|
|
13
13
|
qv_token: config.qv_token,
|
|
14
|
-
|
|
14
|
+
timezoneOffset: getAttribute(config, "timezone_offset") || config.timezoneOffset,
|
|
15
15
|
userid: getAttribute(config, "user_id") || config.userid,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
@@ -36,13 +36,13 @@ export function excludeFiltersByParams(filterData, params) {
|
|
|
36
36
|
return value
|
|
37
37
|
.map((rValue) => {
|
|
38
38
|
if (params.enableds == null ||
|
|
39
|
-
params.enableds === rValue.enabled)
|
|
39
|
+
params.enableds.values === rValue.enabled)
|
|
40
40
|
return rValue;
|
|
41
41
|
})
|
|
42
42
|
.filter(Boolean);
|
|
43
43
|
}
|
|
44
44
|
if (params.enableds == null ||
|
|
45
|
-
params.enableds ===
|
|
45
|
+
params.enableds.values ===
|
|
46
46
|
value.enabled)
|
|
47
47
|
return value;
|
|
48
48
|
})
|
|
@@ -63,19 +63,19 @@ export function excludeFiltersByParams(filterData, params) {
|
|
|
63
63
|
return _filterData.scopes.length > 0 ? _filterData : undefined;
|
|
64
64
|
}
|
|
65
65
|
function resolveScopeConditions(scope, params) {
|
|
66
|
-
return ((params.enableds == null || params.enableds !== scope.enabled) &&
|
|
66
|
+
return ((params.enableds == null || params.enableds.scopes !== scope.enabled) &&
|
|
67
67
|
(isEmpty(params.scope) || scope.scope !== params.scope) &&
|
|
68
68
|
(isEmpty(params.scopeid) || scope.scopeid !== params.scopeid) &&
|
|
69
69
|
scope.datasets.length > 0);
|
|
70
70
|
}
|
|
71
71
|
function resolveDatasetConditions(dataset, params) {
|
|
72
|
-
return ((params.enableds == null || params.enableds !== dataset.enabled) &&
|
|
72
|
+
return ((params.enableds == null || params.enableds.datasets !== dataset.enabled) &&
|
|
73
73
|
(isEmpty(params.qrveyid) || params.qrveyid !== dataset.qrveyid) &&
|
|
74
74
|
dataset.filters.length > 0);
|
|
75
75
|
}
|
|
76
76
|
function resolveFilterConditions(filter, params) {
|
|
77
77
|
var _a, _b, _c, _d;
|
|
78
|
-
return ((params.enableds == null || params.enableds !== filter.enabled) &&
|
|
78
|
+
return ((params.enableds == null || params.enableds.filters !== filter.enabled) &&
|
|
79
79
|
(isEmpty(params.dateSection) ||
|
|
80
80
|
params.dateSection !== filter.dateSection) &&
|
|
81
81
|
(isEmpty(params.panelid) || params.panelid !== filter.extras.panelid) &&
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IDTimezoneOffset } from "../../../dates/interfaces/IDTimezoneOffset";
|
|
2
|
+
import { IFSData } from "../../interfaces/common/IFSData";
|
|
3
|
+
import { IFUData } from "../../interfaces/ui/IFUData";
|
|
4
|
+
export declare function setTimezoneToFilters(filterData: IFSData, timezoneOffset: IDTimezoneOffset): IFUData | IFSData;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isEmpty } from "../../../general/mix/isEmpty";
|
|
2
|
+
import { transformFilterValues } from "../ui/transformFilterValues";
|
|
3
|
+
export function setTimezoneToFilters(filterData, timezoneOffset) {
|
|
4
|
+
if (isEmpty(filterData) ||
|
|
5
|
+
isEmpty(filterData.scopes) ||
|
|
6
|
+
!Array.isArray(filterData.scopes))
|
|
7
|
+
return filterData;
|
|
8
|
+
return Object.assign(Object.assign({}, filterData), { scopes: filterData.scopes.map((scope) => (Object.assign(Object.assign({}, scope), { datasets: scope.datasets.map((dataset) => (Object.assign(Object.assign({}, dataset), { filters: dataset.filters.map((filter) => (Object.assign(Object.assign({}, filter), { values: transformFilterValues(filter, {
|
|
9
|
+
timezoneOffset,
|
|
10
|
+
translate: undefined,
|
|
11
|
+
i18n: undefined,
|
|
12
|
+
}) }))) }))) }))) });
|
|
13
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IDateGroupingProperty } from "../../dates/interfaces/IDateGroupingProperty";
|
|
2
|
-
export
|
|
2
|
+
export type IFDateProperty = IDateGroupingProperty;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_DATE_SECTION } from "../constants/common/FILTER_DATE_SECTION";
|
|
2
|
-
export
|
|
2
|
+
export type IFDateSection = FILTER_DATE_SECTION;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_OPERATOR } from "../constants/common/FILTER_OPERATOR";
|
|
2
|
-
export
|
|
2
|
+
export type IFOperator = FILTER_OPERATOR;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IColumnPropertyType } from "../../columns/interfaces/IColumnPropertyType";
|
|
2
|
-
export
|
|
2
|
+
export type IFProperty = IColumnPropertyType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_SCOPE } from "../constants/common/FILTER_SCOPE";
|
|
2
|
-
export
|
|
2
|
+
export type IFScope = FILTER_SCOPE;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_SECTION } from "../constants/common/FILTER_SECTION";
|
|
2
|
-
export
|
|
2
|
+
export type IFSection = FILTER_SECTION;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_STRUCTURE_TYPE } from "../constants/common/FILTER_STRUCTURE_TYPE";
|
|
2
|
-
export
|
|
2
|
+
export type IFStructureType = FILTER_STRUCTURE_TYPE;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_VALIDATOR } from "../constants/common/FILTER_VALIDATOR";
|
|
2
|
-
export
|
|
2
|
+
export type IFValidator = FILTER_VALIDATOR;
|
|
@@ -2,4 +2,4 @@ import { IFSValue } from "./common/IFSValue";
|
|
|
2
2
|
import { IFSValueRange } from "./common/IFSValueRange";
|
|
3
3
|
import { IFSValueRanking } from "./common/IFSValueRanking";
|
|
4
4
|
import { IFSValueRelativeDate } from "./common/IFSValueRelativeDate";
|
|
5
|
-
export
|
|
5
|
+
export type IFValue = IFSValue | IFSValueRange | IFSValueRelativeDate | IFSValueRanking[];
|
|
@@ -19,14 +19,14 @@ export interface OLD_IFilterExpression {
|
|
|
19
19
|
value?: IFBackendExpressionValue[];
|
|
20
20
|
uiExtras?: OLD_IFilterDetail;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type IFilterExpressionValue = IFilterNumericExpressionValue | IFilterStringExpressionValue | IFilterRankingExpressionValue | IFBResultRelativeDate[];
|
|
23
23
|
interface IFilterNumericExpressionValue {
|
|
24
24
|
gt?: string;
|
|
25
25
|
gte?: string;
|
|
26
26
|
lt?: string;
|
|
27
27
|
lte?: string;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
type IFilterStringExpressionValue = string;
|
|
30
30
|
interface IFilterRankingExpressionValue {
|
|
31
31
|
position: number;
|
|
32
32
|
value: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IFSValueRelativeDate } from "../common/IFSValueRelativeDate";
|
|
2
|
-
export
|
|
2
|
+
export type IFBExpressionRelativeDate = IFSValueRelativeDate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type IFBExpressionValue = string;
|
|
@@ -2,4 +2,4 @@ import { IFBExpressionRelativeDate } from "./IFBExpressionRelativeDate";
|
|
|
2
2
|
import { IFBExpressionValue } from "./IFBExpressionValue";
|
|
3
3
|
import { IFBExpressionValueRange } from "./IFBExpressionValueRange";
|
|
4
4
|
import { IFBExpressionValueRanking } from "./IFBExpressionValueRanking";
|
|
5
|
-
export
|
|
5
|
+
export type IFBackendExpressionValue = IFBExpressionValue | IFBExpressionValueRange | IFBExpressionRelativeDate | IFBExpressionValueRanking;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_BACKEND_VALIDATOR } from "../../constants/backend/FILTER_BACKEND_VALIDATOR";
|
|
2
|
-
export
|
|
2
|
+
export type IFBackendValidator = FILTER_BACKEND_VALIDATOR;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IColumn } from "../../../columns/interfaces/IColumn";
|
|
2
|
-
export
|
|
2
|
+
export type IFSColumn = Omit<IColumn, "expressionCategory" | "expressionNegative" | "expressionPositive" | "expressionWords" | "label" | "lookupValue" | "slidebarValue">;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IFFiltersGetData } from "../functions/IFFiltersGetData";
|
|
2
|
-
export
|
|
2
|
+
export type IFSGetDataValues = IFFiltersGetData;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IWidgetConfig } from "../../../interfaces/general/IWidgetConfig";
|
|
2
|
-
export
|
|
2
|
+
export type IFilterConfig = IWidgetConfig;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_PANEL_ACTION } from "../../constants/panel/FILTER_PANEL_ACTION";
|
|
2
|
-
export
|
|
2
|
+
export type IFPAction = FILTER_PANEL_ACTION;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FILTER_PANEL_VIEW } from "../../constants/panel/FILTER_PANEL_VIEW";
|
|
2
|
-
export
|
|
2
|
+
export type IFPSettingsPanelView = FILTER_PANEL_VIEW;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IDTimezoneOffset } from "../../../dates/interfaces/IDTimezoneOffset";
|
|
1
2
|
import { II18nConfig } from "../../../globalization/interfaces/II18nConfig";
|
|
2
3
|
import { II18nServiceTranslate } from "../../../globalization/interfaces/II18nServiceTranslate";
|
|
3
4
|
export interface IFUTransformFilterValuesSettings {
|
|
5
|
+
timezoneOffset: IDTimezoneOffset;
|
|
4
6
|
translate: II18nServiceTranslate;
|
|
5
7
|
i18n: II18nConfig;
|
|
6
8
|
suffixTranslateLabel?: string;
|
|
@@ -97,7 +97,7 @@ export class FiltersApi {
|
|
|
97
97
|
else {
|
|
98
98
|
api = this.chartPaginationApi;
|
|
99
99
|
}
|
|
100
|
-
return api.getChartResult(this.config, FiltersApi.getFilter(config), FiltersApi.getLogic(config), FiltersApi.getChartRequest(config), resetApi);
|
|
100
|
+
return api.getChartResult(Object.assign(Object.assign({}, this.config), { timezoneOffset: 0 }), FiltersApi.getFilter(config), FiltersApi.getLogic(config), FiltersApi.getChartRequest(config), resetApi);
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
static getLogic(config) {
|
|
@@ -101,7 +101,8 @@ export class DurationFormatter {
|
|
|
101
101
|
*/
|
|
102
102
|
parseFormatTemplate(template) {
|
|
103
103
|
this.template = isEmpty(template) ? "" : template;
|
|
104
|
-
|
|
104
|
+
const templateParts = this.template.match(PARTS_REGEX) || [];
|
|
105
|
+
return templateParts
|
|
105
106
|
.reduce((store, part) => {
|
|
106
107
|
const config = DURATION_PARTS[part[0]];
|
|
107
108
|
if (config)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FORMULA } from "../constants/FORMULA";
|
|
2
|
-
export
|
|
2
|
+
export type IFormulaType = FORMULA;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @returns the new array created.
|
|
15
15
|
*/
|
|
16
16
|
export declare function addPropertyToArrayOfObjects(obj: AddPropertyToArrayOfObjectsParams): any[];
|
|
17
|
-
|
|
17
|
+
type AddPropertyToArrayOfObjectsParams = {
|
|
18
18
|
array: any[];
|
|
19
19
|
property: string;
|
|
20
20
|
value: any;
|
package/dist/general/index.d.ts
CHANGED
package/dist/general/index.js
CHANGED
|
@@ -49,5 +49,5 @@ export interface IScriptItem {
|
|
|
49
49
|
noModule?: boolean;
|
|
50
50
|
type?: string;
|
|
51
51
|
}
|
|
52
|
-
export
|
|
53
|
-
export
|
|
52
|
+
export type TScriptItem = string | IScriptItem;
|
|
53
|
+
export type TScriptType = "text/javascript" | "module" | string;
|