@qrvey/utils 1.2.9-14 → 1.2.9-18
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/README.md +755 -652
- package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
- package/dist/cjs/filters/helpers/ui/index.d.ts +1 -0
- package/dist/cjs/filters/helpers/ui/index.js +1 -0
- package/dist/cjs/filters/helpers/ui/transformFilterValues.d.ts +4 -0
- package/dist/cjs/filters/helpers/ui/transformFilterValues.js +22 -0
- package/dist/cjs/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
- package/dist/cjs/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
- package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
- package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +2 -0
- package/dist/cjs/filters/interfaces/ui/index.d.ts +3 -2
- package/dist/cjs/filters/interfaces/ui/index.js +3 -2
- package/dist/cjs/format/definition.d.ts +17 -0
- package/dist/cjs/format/definition.js +31 -1
- package/dist/cjs/format/format.d.ts +2 -1
- package/dist/cjs/format/format.js +8 -5
- package/dist/cjs/format/index.d.ts +1 -0
- package/dist/cjs/format/index.js +1 -0
- package/dist/cjs/format/localization.d.ts +3 -0
- package/dist/cjs/format/localization.js +56 -0
- package/dist/cjs/globalization/helpers/getI18nCalendar.d.ts +4 -0
- package/dist/cjs/globalization/helpers/getI18nCalendar.js +69 -0
- package/dist/cjs/globalization/helpers/index.d.ts +1 -0
- package/dist/cjs/globalization/helpers/index.js +1 -0
- package/dist/cjs/globalization/interfaces/calendar/II18nCalendar.d.ts +7 -0
- package/dist/cjs/globalization/interfaces/calendar/II18nCalendar.js +2 -0
- package/dist/cjs/globalization/interfaces/calendar/II18nCalendarProperties.d.ts +9 -0
- package/dist/cjs/globalization/interfaces/calendar/II18nCalendarProperties.js +2 -0
- package/dist/cjs/globalization/interfaces/calendar/index.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/calendar/index.js +14 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
- package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/common/II18nDayNames.d.ts +7 -0
- package/dist/cjs/globalization/interfaces/filters/II18nFilter.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/filters/II18nTokenBox.d.ts +6 -0
- package/dist/cjs/globalization/interfaces/filters/II18nTokenBox.js +2 -0
- package/dist/cjs/globalization/interfaces/index.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/index.js +1 -0
- package/dist/cjs/globalization/labels/calendar/I18N_CALENDAR.d.ts +2 -0
- package/dist/cjs/globalization/labels/calendar/I18N_CALENDAR.js +10 -0
- package/dist/cjs/globalization/labels/calendar/index.d.ts +1 -0
- package/dist/cjs/globalization/labels/calendar/index.js +13 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
- package/dist/cjs/globalization/labels/common/I18N_COMMON.js +2 -0
- package/dist/cjs/globalization/labels/common/I18N_DAY_NAMES.js +7 -0
- package/dist/cjs/globalization/labels/filters/I18N_FILTER.js +6 -0
- package/dist/cjs/globalization/labels/index.d.ts +1 -0
- package/dist/cjs/globalization/labels/index.js +1 -0
- package/dist/cjs/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
- package/dist/cjs/interfaces/format/IFormatConfig.Interface.js +2 -0
- package/dist/cjs/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
- package/dist/cjs/interfaces/format/IFormatCurrency.Interface.js +2 -0
- package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
- package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.js +2 -0
- package/dist/cjs/interfaces/format/index.d.ts +3 -0
- package/dist/cjs/interfaces/format/index.js +15 -0
- package/dist/cjs/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
- package/dist/cjs/interfaces/index.d.ts +1 -0
- package/dist/cjs/interfaces/index.js +1 -0
- package/dist/cjs/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
- package/dist/cjs/qrvey/helpers/getValueWithSuffixes.js +23 -0
- package/dist/cjs/qrvey/helpers/index.d.ts +2 -0
- package/dist/cjs/qrvey/helpers/index.js +2 -0
- package/dist/cjs/qrvey/helpers/transformValue.d.ts +8 -0
- package/dist/cjs/qrvey/helpers/transformValue.js +46 -0
- package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
- package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.js +2 -0
- package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
- package/dist/cjs/qrvey/interfaces/ITransformValueSettings.js +2 -0
- package/dist/cjs/qrvey/interfaces/index.d.ts +2 -0
- package/dist/cjs/qrvey/interfaces/index.js +2 -0
- package/dist/cjs/services/api/getDatasetColumns.api.js +5 -1
- package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
- package/dist/filters/helpers/ui/index.d.ts +1 -0
- package/dist/filters/helpers/ui/index.js +1 -0
- package/dist/filters/helpers/ui/transformFilterValues.d.ts +4 -0
- package/dist/filters/helpers/ui/transformFilterValues.js +18 -0
- package/dist/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
- package/dist/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
- package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
- package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +1 -0
- package/dist/filters/interfaces/ui/index.d.ts +3 -2
- package/dist/filters/interfaces/ui/index.js +3 -2
- package/dist/format/definition.d.ts +17 -0
- package/dist/format/definition.js +30 -0
- package/dist/format/format.d.ts +2 -1
- package/dist/format/format.js +6 -3
- package/dist/format/index.d.ts +1 -0
- package/dist/format/index.js +1 -0
- package/dist/format/localization.d.ts +3 -0
- package/dist/format/localization.js +51 -0
- package/dist/globalization/helpers/getI18nCalendar.d.ts +4 -0
- package/dist/globalization/helpers/getI18nCalendar.js +65 -0
- package/dist/globalization/helpers/index.d.ts +1 -0
- package/dist/globalization/helpers/index.js +1 -0
- package/dist/globalization/interfaces/calendar/II18nCalendar.d.ts +7 -0
- package/dist/globalization/interfaces/calendar/II18nCalendar.js +1 -0
- package/dist/globalization/interfaces/calendar/II18nCalendarProperties.d.ts +9 -0
- package/dist/globalization/interfaces/calendar/II18nCalendarProperties.js +1 -0
- package/dist/globalization/interfaces/calendar/index.d.ts +2 -0
- package/dist/globalization/interfaces/calendar/index.js +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
- package/dist/globalization/interfaces/common/II18nCommon.d.ts +2 -0
- package/dist/globalization/interfaces/common/II18nDayNames.d.ts +7 -0
- package/dist/globalization/interfaces/filters/II18nFilter.d.ts +2 -0
- package/dist/globalization/interfaces/filters/II18nTokenBox.d.ts +6 -0
- package/dist/globalization/interfaces/filters/II18nTokenBox.js +1 -0
- package/dist/globalization/interfaces/index.d.ts +1 -0
- package/dist/globalization/interfaces/index.js +1 -0
- package/dist/globalization/labels/calendar/I18N_CALENDAR.d.ts +2 -0
- package/dist/globalization/labels/calendar/I18N_CALENDAR.js +7 -0
- package/dist/globalization/labels/calendar/index.d.ts +1 -0
- package/dist/globalization/labels/calendar/index.js +1 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
- package/dist/globalization/labels/common/I18N_COMMON.js +2 -0
- package/dist/globalization/labels/common/I18N_DAY_NAMES.js +7 -0
- package/dist/globalization/labels/filters/I18N_FILTER.js +6 -0
- package/dist/globalization/labels/index.d.ts +1 -0
- package/dist/globalization/labels/index.js +1 -0
- package/dist/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
- package/dist/interfaces/format/IFormatConfig.Interface.js +1 -0
- package/dist/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
- package/dist/interfaces/format/IFormatCurrency.Interface.js +1 -0
- package/dist/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
- package/dist/interfaces/format/IFormatOutputFormat.Interface.js +1 -0
- package/dist/interfaces/format/index.d.ts +3 -0
- package/dist/interfaces/format/index.js +3 -0
- package/dist/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
- package/dist/qrvey/helpers/getValueWithSuffixes.js +19 -0
- package/dist/qrvey/helpers/index.d.ts +2 -0
- package/dist/qrvey/helpers/index.js +2 -0
- package/dist/qrvey/helpers/transformValue.d.ts +8 -0
- package/dist/qrvey/helpers/transformValue.js +42 -0
- package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
- package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.js +1 -0
- package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
- package/dist/qrvey/interfaces/ITransformValueSettings.js +1 -0
- package/dist/qrvey/interfaces/index.d.ts +2 -0
- package/dist/qrvey/interfaces/index.js +2 -0
- package/dist/services/api/getDatasetColumns.api.js +5 -1
- package/package.json +1 -1
- package/src/filters/helpers/builder/getFilterBuilderGeneralConfig.ts +1 -0
- package/src/filters/helpers/ui/index.ts +1 -0
- package/src/filters/helpers/ui/transformFilterValues.ts +29 -0
- package/src/filters/interfaces/builder/IFilterBuilderGeneralConfig.ts +2 -1
- package/src/filters/interfaces/panel/IFilterPanelConfig.ts +1 -0
- package/src/filters/interfaces/ui/IFUTransformFilterValuesSettings.ts +7 -0
- package/src/filters/interfaces/ui/index.ts +3 -2
- package/src/format/definition.ts +45 -0
- package/src/format/format.ts +19 -15
- package/src/format/index.ts +1 -0
- package/src/format/localization.ts +52 -0
- package/src/globalization/helpers/getI18nCalendar.ts +68 -0
- package/src/globalization/helpers/index.ts +1 -0
- package/src/globalization/interfaces/calendar/II18nCalendar.ts +7 -0
- package/src/globalization/interfaces/calendar/II18nCalendarProperties.ts +9 -0
- package/src/globalization/interfaces/calendar/index.ts +2 -0
- package/src/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.ts +5 -3
- package/src/globalization/interfaces/common/II18nCommon.ts +2 -0
- package/src/globalization/interfaces/common/II18nDayNames.ts +8 -0
- package/src/globalization/interfaces/filters/II18nFilter.ts +2 -0
- package/src/globalization/interfaces/filters/II18nTokenBox.ts +6 -0
- package/src/globalization/interfaces/index.ts +1 -0
- package/src/globalization/labels/calendar/I18N_CALENDAR.ts +9 -0
- package/src/globalization/labels/calendar/index.ts +1 -0
- package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.ts +1 -1
- package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +8 -6
- package/src/globalization/labels/common/I18N_COMMON.ts +2 -0
- package/src/globalization/labels/common/I18N_DAY_NAMES.ts +8 -0
- package/src/globalization/labels/filters/I18N_FILTER.ts +6 -0
- package/src/globalization/labels/index.ts +1 -0
- package/src/interfaces/format/IFormatConfig.Interface.ts +5 -0
- package/src/interfaces/format/IFormatCurrency.Interface.ts +4 -0
- package/src/interfaces/format/IFormatOutputFormat.Interface.ts +9 -0
- package/src/interfaces/format/index.ts +3 -0
- package/src/interfaces/general/IGeneralWidgetConfig.ts +2 -0
- package/src/interfaces/index.ts +1 -0
- package/src/qrvey/helpers/getValueWithSuffixes.ts +19 -0
- package/src/qrvey/helpers/index.ts +2 -0
- package/src/qrvey/helpers/transformValue.ts +47 -0
- package/src/qrvey/interfaces/IGetValueWithSuffixesSettings.ts +12 -0
- package/src/qrvey/interfaces/ITransformValueSettings.ts +12 -0
- package/src/qrvey/interfaces/index.ts +2 -0
- package/src/services/api/getDatasetColumns.api.ts +4 -1
- package/test/columns/isNumericalColumn.test.js +154 -0
- package/test/format.test.js +11 -11
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
const { COLUMN, FORMULA, isNumericalColumn } = require("../../dist/cjs");
|
|
2
|
+
|
|
3
|
+
const column1 = {
|
|
4
|
+
id: '123',
|
|
5
|
+
qrveyid: 'abc',
|
|
6
|
+
type: COLUMN.NUMERIC
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const column2 = {
|
|
10
|
+
id: '222',
|
|
11
|
+
qrveyid: 'abc',
|
|
12
|
+
type: COLUMN.RATING
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const column3 = {
|
|
16
|
+
id: '333',
|
|
17
|
+
qrveyid: 'abc',
|
|
18
|
+
type: COLUMN.SLIDEBAR
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const column4 = {
|
|
22
|
+
formulaid: '456',
|
|
23
|
+
formulaType: FORMULA.NUMBER,
|
|
24
|
+
id: '456',
|
|
25
|
+
qrveyid: 'abc',
|
|
26
|
+
type: COLUMN.FORMULA
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const wrongColumn1 = {
|
|
30
|
+
formulaid: '456',
|
|
31
|
+
formulaType: FORMULA.DATE,
|
|
32
|
+
id: '494',
|
|
33
|
+
qrveyid: 'abc',
|
|
34
|
+
type: COLUMN.FORMULA
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const wrongColumn2 = {
|
|
38
|
+
id: '789',
|
|
39
|
+
qrveyid: 'abc',
|
|
40
|
+
type: COLUMN.TEXTFIELD
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
describe('Testing undefined/empty arguments', function () {
|
|
44
|
+
const empty1 = undefined;
|
|
45
|
+
const empty2 = null;
|
|
46
|
+
const empty3 = '';
|
|
47
|
+
const empty4 = [];
|
|
48
|
+
const empty5 = {};
|
|
49
|
+
|
|
50
|
+
test('no argument passed', function () {
|
|
51
|
+
const validation = isNumericalColumn();
|
|
52
|
+
expect(validation).toBeFalsy();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('Undefined argument', function () {
|
|
56
|
+
const validation = isNumericalColumn(empty1);
|
|
57
|
+
expect(validation).toBeFalsy();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('Null argument', function () {
|
|
61
|
+
const validation = isNumericalColumn(empty2);
|
|
62
|
+
expect(validation).toBeFalsy();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('Empty string argument', function () {
|
|
66
|
+
const validation = isNumericalColumn(empty3);
|
|
67
|
+
expect(validation).toBeFalsy();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('Empty array argument', function () {
|
|
71
|
+
const validation = isNumericalColumn(empty4);
|
|
72
|
+
expect(validation).toBeFalsy();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('Empty object argument', function () {
|
|
76
|
+
const validation = isNumericalColumn(empty5);
|
|
77
|
+
expect(validation).toBeFalsy();
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('Testing no-object arguments', function () {
|
|
82
|
+
const variable1 = 1;
|
|
83
|
+
const variable2 = false;
|
|
84
|
+
const variable3 = new Date();
|
|
85
|
+
const variable4 = ['Hello', 'World'];
|
|
86
|
+
const variable5 = (num1 = 1, num2 = 2) => num1 + num2;
|
|
87
|
+
|
|
88
|
+
test('Numeric variable', function () {
|
|
89
|
+
const validation = isNumericalColumn(variable1);
|
|
90
|
+
expect(validation).toBeFalsy();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test('Boolean variable', function () {
|
|
94
|
+
const validation = isNumericalColumn(variable2);
|
|
95
|
+
expect(validation).toBeFalsy();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test('Date object variable', function () {
|
|
99
|
+
const validation = isNumericalColumn(variable3);
|
|
100
|
+
expect(validation).toBeFalsy();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test('Array variable', function () {
|
|
104
|
+
const validation = isNumericalColumn(variable4);
|
|
105
|
+
expect(validation).toBeFalsy();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('Function-like variable', function () {
|
|
109
|
+
const validation = isNumericalColumn(variable5);
|
|
110
|
+
expect(validation).toBeFalsy();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe('Testing invalid expected object', function () {
|
|
115
|
+
const variable1 = { tag1: 'value1', tag2: 'value2' };
|
|
116
|
+
|
|
117
|
+
test('Different expected object', function () {
|
|
118
|
+
const validation = isNumericalColumn(variable1);
|
|
119
|
+
expect(validation).toBeFalsy();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test('Different column type 2', function () {
|
|
123
|
+
const validation = isNumericalColumn(wrongColumn1);
|
|
124
|
+
expect(validation).toBeFalsy();
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test('Different column type 1', function () {
|
|
128
|
+
const validation = isNumericalColumn(wrongColumn2);
|
|
129
|
+
expect(validation).toBeFalsy();
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
describe('Regular scenarios', function () {
|
|
134
|
+
test('Scenario #1 - Numeric column type', function () {
|
|
135
|
+
const validation = isNumericalColumn(column1);
|
|
136
|
+
expect(validation).toBeTruthy();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test('Scenario #2 - Rating column type', function () {
|
|
140
|
+
const validation = isNumericalColumn(column2);
|
|
141
|
+
expect(validation).toBeTruthy();
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
test('Scenario #4 - Slidebar column type', function () {
|
|
145
|
+
const validation = isNumericalColumn(column3);
|
|
146
|
+
expect(validation).toBeTruthy();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
test('Scenario #4 - Formula column type with a number type', function () {
|
|
150
|
+
const validation = isNumericalColumn(column4);
|
|
151
|
+
expect(validation).toBeTruthy();
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
});
|
package/test/format.test.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { addFormat, defineFormat, formatAbbreviated } = require('../dist/cjs');
|
|
2
2
|
|
|
3
3
|
describe('Testing format util', function () {
|
|
4
4
|
test('Number formats', function () {
|
|
5
|
-
const abbreviated =
|
|
5
|
+
const abbreviated = addFormat('1000000', {
|
|
6
6
|
"type": "NUMERIC",
|
|
7
7
|
"format": "Abbreviated",
|
|
8
8
|
"decimals": "3"
|
|
9
9
|
});
|
|
10
10
|
expect(abbreviated).toEqual('1.00M');
|
|
11
11
|
|
|
12
|
-
const numeric =
|
|
12
|
+
const numeric = addFormat('1000000', {
|
|
13
13
|
"type": "NUMERIC",
|
|
14
14
|
"format": "Numeric",
|
|
15
15
|
"decimals": "3"
|
|
16
16
|
});
|
|
17
17
|
expect(numeric).toEqual('1,000,000.000');
|
|
18
18
|
|
|
19
|
-
const currency =
|
|
19
|
+
const currency = addFormat('1000000', {
|
|
20
20
|
"type": "NUMERIC",
|
|
21
21
|
"format": "Currency",
|
|
22
22
|
"decimals": "3"
|
|
23
23
|
});
|
|
24
24
|
expect(currency).toEqual(' $1,000,000.000');
|
|
25
25
|
|
|
26
|
-
const percentage =
|
|
26
|
+
const percentage = addFormat('1000000', {
|
|
27
27
|
"type": "NUMERIC",
|
|
28
28
|
"format": "Percentage",
|
|
29
29
|
"decimals": "3"
|
|
@@ -32,31 +32,31 @@ describe('Testing format util', function () {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
test('Date formats', function () {
|
|
35
|
-
const yyyyMMdd =
|
|
35
|
+
const yyyyMMdd = addFormat('2021-08-06', {
|
|
36
36
|
"type": "DATE",
|
|
37
37
|
"format": "MM/DD/YYYY HH24:MM:SS"
|
|
38
38
|
});
|
|
39
39
|
expect(yyyyMMdd).toEqual('08/06/2021 00:00:00');
|
|
40
40
|
|
|
41
|
-
const yyyyMMddHHmmSS =
|
|
41
|
+
const yyyyMMddHHmmSS = addFormat('2021-08-06 05:30:50', {
|
|
42
42
|
"type": "DATE",
|
|
43
43
|
"format": "MM/DD/YYYY HH24:MM:SS"
|
|
44
44
|
});
|
|
45
45
|
expect(yyyyMMddHHmmSS).toEqual('08/06/2021 05:30:50');
|
|
46
46
|
|
|
47
|
-
const ISOFormat =
|
|
47
|
+
const ISOFormat = addFormat('2021-06-09T13:15:46', {
|
|
48
48
|
"type": "DATE",
|
|
49
49
|
"format": "MM/DD/YYYY hh:MM:SS"
|
|
50
50
|
});
|
|
51
51
|
expect(ISOFormat).toEqual('06/09/2021 01:15:46');
|
|
52
52
|
|
|
53
|
-
const ISOFormatRandom =
|
|
53
|
+
const ISOFormatRandom = addFormat('2021-06-09T13:15:46', {
|
|
54
54
|
"type": "DATE",
|
|
55
55
|
"format": "MM YYYY H M s"
|
|
56
56
|
});
|
|
57
57
|
expect(ISOFormatRandom).toEqual('06 2021 13 6 46');
|
|
58
58
|
|
|
59
|
-
const ISOFormatRandom1 =
|
|
59
|
+
const ISOFormatRandom1 = addFormat('2018-01-01T00:00:00', {
|
|
60
60
|
"type": "DATE",
|
|
61
61
|
"format": "Q MMMM Do ddd"
|
|
62
62
|
});
|
|
@@ -336,7 +336,7 @@ describe('Define format tests', function () {
|
|
|
336
336
|
|
|
337
337
|
const format = defineFormat(column, true);
|
|
338
338
|
expect(format).toEqual({ type: 'NUMERIC', format: 'Currency', decimals: '3' });
|
|
339
|
-
const currency =
|
|
339
|
+
const currency = addFormat('1000000', format);
|
|
340
340
|
expect(currency).toEqual(' $1,000,000.000');
|
|
341
341
|
});
|
|
342
342
|
|