blixify-ui-web 1.3.16 → 1.3.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/lib/components/data/columnTypes/dateFormat.d.ts +44 -0
- package/lib/components/data/columnTypes/dateFormat.d.ts.map +1 -0
- package/lib/components/data/columnTypes/dateFormat.js +111 -0
- package/lib/components/data/columnTypes/dateFormat.js.map +1 -0
- package/lib/components/data/columnTypes/index.d.ts +1 -0
- package/lib/components/data/columnTypes/index.d.ts.map +1 -1
- package/lib/components/data/columnTypes/index.js +1 -0
- package/lib/components/data/columnTypes/index.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +21 -8
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +14 -0
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +18 -9
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +3 -0
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +1 -1
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +1 -0
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +60 -44
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/input/datePicker/index.d.ts +1 -0
- package/lib/components/input/datePicker/index.d.ts.map +1 -1
- package/lib/components/input/datePicker/index.js +12 -4
- package/lib/components/input/datePicker/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import dayjs from "../../dayjs";
|
|
2
|
+
/**
|
|
3
|
+
* A date column's display format (`dateFormat` on the column), as dayjs
|
|
4
|
+
* tokens. The table, the record view, the form's picker and Space's documents
|
|
5
|
+
* all write the date this way. A column without one keeps the format each of
|
|
6
|
+
* them has always used.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DATE_FORMAT_OPTIONS: string[];
|
|
9
|
+
/**
|
|
10
|
+
* A column format in the picker's date-fns tokens, or undefined for a format
|
|
11
|
+
* outside DATE_FORMAT_OPTIONS, which leaves the picker's own.
|
|
12
|
+
*/
|
|
13
|
+
export declare const handleGetPickerDateFormat: (format?: any) => string | undefined;
|
|
14
|
+
export declare const LIST_DATE_FORMAT = "YYYY-MM-DD hh:mm A";
|
|
15
|
+
/**
|
|
16
|
+
* Whether a value is one of the listed formats. Anything else, such as a
|
|
17
|
+
* number or a misspelt string, is not used, since dayjs throws on a format
|
|
18
|
+
* that is not text and writes a misspelt one as nonsense.
|
|
19
|
+
*/
|
|
20
|
+
export declare const handleIsDateFormat: (format: any) => format is string;
|
|
21
|
+
/**
|
|
22
|
+
* The column's own format, or undefined when it has none, has one outside
|
|
23
|
+
* DATE_FORMAT_OPTIONS, or is a time-only column, which always shows its time
|
|
24
|
+
* alone.
|
|
25
|
+
*/
|
|
26
|
+
export declare const handleGetColumnDateFormat: (column?: {
|
|
27
|
+
dateFormat?: any;
|
|
28
|
+
hideShowDate?: boolean;
|
|
29
|
+
}) => string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* A date value read into dayjs: a Date, an ISO string, a millisecond number,
|
|
32
|
+
* or a Firestore timestamp ({ _seconds } or { seconds }).
|
|
33
|
+
*/
|
|
34
|
+
export declare const handleReadDateValue: (value: any) => any;
|
|
35
|
+
/**
|
|
36
|
+
* A date written in the given format, or "" when the value is not a date.
|
|
37
|
+
*/
|
|
38
|
+
export declare const handleFormatDateText: (value: any, format: string) => any;
|
|
39
|
+
/**
|
|
40
|
+
* A date the list wrote out, read back: in the column's own format first,
|
|
41
|
+
* then the list's usual one.
|
|
42
|
+
*/
|
|
43
|
+
export declare const handleParseListDate: (text: any, dateFormat?: string) => dayjs.Dayjs;
|
|
44
|
+
//# sourceMappingURL=dateFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateFormat.d.ts","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/dateFormat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,EASvC,CAAC;AAeF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,YAAa,GAAG,uBACW,CAAC;AAIlE,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,GAAG,KAAG,MAAM,IAAI,MACS,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,YAAa;IACjD,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,uBAGc,CAAC;AAEhB;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAAW,GAAG,QAc7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,UAAW,GAAG,UAAU,MAAM,QACb,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,SAAU,GAAG,eAAe,MAAM,gBAejE,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.handleParseListDate = exports.handleFormatDateText = exports.handleReadDateValue = exports.handleGetColumnDateFormat = exports.handleIsDateFormat = exports.LIST_DATE_FORMAT = exports.handleGetPickerDateFormat = exports.DATE_FORMAT_OPTIONS = void 0;
|
|
7
|
+
var dayjs_1 = __importDefault(require("../../dayjs"));
|
|
8
|
+
/**
|
|
9
|
+
* A date column's display format (`dateFormat` on the column), as dayjs
|
|
10
|
+
* tokens. The table, the record view, the form's picker and Space's documents
|
|
11
|
+
* all write the date this way. A column without one keeps the format each of
|
|
12
|
+
* them has always used.
|
|
13
|
+
*/
|
|
14
|
+
exports.DATE_FORMAT_OPTIONS = [
|
|
15
|
+
"DD/MM/YYYY",
|
|
16
|
+
"D MMM YYYY",
|
|
17
|
+
"D MMMM YYYY",
|
|
18
|
+
"dddd, D MMMM YYYY",
|
|
19
|
+
"YYYY-MM-DD",
|
|
20
|
+
"MM/DD/YYYY",
|
|
21
|
+
"DD/MM/YYYY h:mm A",
|
|
22
|
+
"D MMM YYYY h:mm A",
|
|
23
|
+
];
|
|
24
|
+
// INFO: the form's picker writes its value with date-fns, whose tokens differ
|
|
25
|
+
// from dayjs's
|
|
26
|
+
var PICKER_FORMATS = {
|
|
27
|
+
"DD/MM/YYYY": "dd/MM/yyyy",
|
|
28
|
+
"D MMM YYYY": "d MMM yyyy",
|
|
29
|
+
"D MMMM YYYY": "d MMMM yyyy",
|
|
30
|
+
"dddd, D MMMM YYYY": "EEEE, d MMMM yyyy",
|
|
31
|
+
"YYYY-MM-DD": "yyyy-MM-dd",
|
|
32
|
+
"MM/DD/YYYY": "MM/dd/yyyy",
|
|
33
|
+
"DD/MM/YYYY h:mm A": "dd/MM/yyyy h:mm aa",
|
|
34
|
+
"D MMM YYYY h:mm A": "d MMM yyyy h:mm aa",
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A column format in the picker's date-fns tokens, or undefined for a format
|
|
38
|
+
* outside DATE_FORMAT_OPTIONS, which leaves the picker's own.
|
|
39
|
+
*/
|
|
40
|
+
var handleGetPickerDateFormat = function (format) {
|
|
41
|
+
return (0, exports.handleIsDateFormat)(format) ? PICKER_FORMATS[format] : undefined;
|
|
42
|
+
};
|
|
43
|
+
exports.handleGetPickerDateFormat = handleGetPickerDateFormat;
|
|
44
|
+
// INFO: the format the list writes a date in when its column has none, which
|
|
45
|
+
// the calendar and timeline tabs parse back
|
|
46
|
+
exports.LIST_DATE_FORMAT = "YYYY-MM-DD hh:mm A";
|
|
47
|
+
/**
|
|
48
|
+
* Whether a value is one of the listed formats. Anything else, such as a
|
|
49
|
+
* number or a misspelt string, is not used, since dayjs throws on a format
|
|
50
|
+
* that is not text and writes a misspelt one as nonsense.
|
|
51
|
+
*/
|
|
52
|
+
var handleIsDateFormat = function (format) {
|
|
53
|
+
return typeof format === "string" && exports.DATE_FORMAT_OPTIONS.includes(format);
|
|
54
|
+
};
|
|
55
|
+
exports.handleIsDateFormat = handleIsDateFormat;
|
|
56
|
+
/**
|
|
57
|
+
* The column's own format, or undefined when it has none, has one outside
|
|
58
|
+
* DATE_FORMAT_OPTIONS, or is a time-only column, which always shows its time
|
|
59
|
+
* alone.
|
|
60
|
+
*/
|
|
61
|
+
var handleGetColumnDateFormat = function (column) {
|
|
62
|
+
return !(column === null || column === void 0 ? void 0 : column.hideShowDate) && (0, exports.handleIsDateFormat)(column === null || column === void 0 ? void 0 : column.dateFormat)
|
|
63
|
+
? column === null || column === void 0 ? void 0 : column.dateFormat
|
|
64
|
+
: undefined;
|
|
65
|
+
};
|
|
66
|
+
exports.handleGetColumnDateFormat = handleGetColumnDateFormat;
|
|
67
|
+
/**
|
|
68
|
+
* A date value read into dayjs: a Date, an ISO string, a millisecond number,
|
|
69
|
+
* or a Firestore timestamp ({ _seconds } or { seconds }).
|
|
70
|
+
*/
|
|
71
|
+
var handleReadDateValue = function (value) {
|
|
72
|
+
if (value === null || value === undefined || value === "")
|
|
73
|
+
return undefined;
|
|
74
|
+
var parsed;
|
|
75
|
+
if (value instanceof Date ||
|
|
76
|
+
typeof value === "string" ||
|
|
77
|
+
typeof value === "number")
|
|
78
|
+
parsed = (0, dayjs_1.default)(value);
|
|
79
|
+
else if (typeof (value === null || value === void 0 ? void 0 : value._seconds) === "number")
|
|
80
|
+
parsed = (0, dayjs_1.default)(value._seconds * 1000);
|
|
81
|
+
else if (typeof (value === null || value === void 0 ? void 0 : value.seconds) === "number")
|
|
82
|
+
parsed = (0, dayjs_1.default)(value.seconds * 1000);
|
|
83
|
+
return (parsed === null || parsed === void 0 ? void 0 : parsed.isValid()) ? parsed : undefined;
|
|
84
|
+
};
|
|
85
|
+
exports.handleReadDateValue = handleReadDateValue;
|
|
86
|
+
/**
|
|
87
|
+
* A date written in the given format, or "" when the value is not a date.
|
|
88
|
+
*/
|
|
89
|
+
var handleFormatDateText = function (value, format) { var _a, _b; return (_b = (_a = (0, exports.handleReadDateValue)(value)) === null || _a === void 0 ? void 0 : _a.format(format)) !== null && _b !== void 0 ? _b : ""; };
|
|
90
|
+
exports.handleFormatDateText = handleFormatDateText;
|
|
91
|
+
/**
|
|
92
|
+
* A date the list wrote out, read back: in the column's own format first,
|
|
93
|
+
* then the list's usual one.
|
|
94
|
+
*/
|
|
95
|
+
var handleParseListDate = function (text, dateFormat) {
|
|
96
|
+
if (text instanceof Date)
|
|
97
|
+
return (0, dayjs_1.default)(text);
|
|
98
|
+
if (typeof text !== "string" || !text)
|
|
99
|
+
return (0, dayjs_1.default)(NaN);
|
|
100
|
+
if (dateFormat) {
|
|
101
|
+
// INFO: dayjs cannot read a weekday's name back, so it is set aside; the
|
|
102
|
+
// date after it says the day on its own
|
|
103
|
+
var withWeekday = /^dddd,?\s*/.test(dateFormat);
|
|
104
|
+
var parsed = (0, dayjs_1.default)(withWeekday ? text.replace(/^[^\s,]+,?\s*/, "") : text, withWeekday ? dateFormat.replace(/^dddd,?\s*/, "") : dateFormat, true);
|
|
105
|
+
if (parsed.isValid())
|
|
106
|
+
return parsed;
|
|
107
|
+
}
|
|
108
|
+
return (0, dayjs_1.default)(text, "YYYY-MM-DD HH:mm A");
|
|
109
|
+
};
|
|
110
|
+
exports.handleParseListDate = handleParseListDate;
|
|
111
|
+
//# sourceMappingURL=dateFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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Y,IAAI;QAAE,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC;IAC7C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI;QAAE,OAAO,IAAA,eAAK,EAAC,GAAG,CAAC,CAAC;IACzD,IAAI,UAAU,EAAE,CAAC;QACf,yEAAyE;QACzE,wCAAwC;QACxC,IAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClD,IAAM,MAAM,GAAG,IAAA,eAAK,EAClB,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EACtD,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAC/D,IAAI,CACL,CAAC;QACF,IAAI,MAAM,CAAC,OAAO,EAAE;YAAE,OAAO,MAAM,CAAC;IACtC,CAAC;IACD,OAAO,IAAA,eAAK,EAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;AAC3C,CAAC,CAAC;AAfW,QAAA,mBAAmB,uBAe9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
|
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
*/
|
|
22
22
|
__exportStar(require("./buttonCell"), exports);
|
|
23
23
|
__exportStar(require("./context"), exports);
|
|
24
|
+
__exportStar(require("./dateFormat"), exports);
|
|
24
25
|
__exportStar(require("./dateRange"), exports);
|
|
25
26
|
__exportStar(require("./dateRangeCell"), exports);
|
|
26
27
|
__exportStar(require("./groupSections"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,+CAA6B;AAC7B,4CAA0B;AAC1B,8CAA4B;AAC5B,kDAAgC;AAChC,kDAAgC;AAChC,2CAAyB;AACzB,+CAA6B;AAC7B,kDAAgC;AAChC,iDAA+B;AAC/B,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,+CAA6B;AAC7B,4CAA0B;AAC1B,+CAA6B;AAC7B,8CAA4B;AAC5B,kDAAgC;AAChC,kDAAgC;AAChC,2CAAyB;AACzB,+CAA6B;AAC7B,kDAAgC;AAChC,iDAA+B;AAC/B,qDAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AAwHf,OAAO,EAEL,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AAwHf,OAAO,EAEL,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;AAoJ1B,eAAO,MAAM,qBAAqB,OAAO,CAAC;AA6C1C,eAAO,MAAM,yBAAyB,UAAW,GAAG,YAYnD,CAAC;AAEF,eAAO,MAAM,YAAY,mFAs9hBvB,CAAC"}
|
|
@@ -166,6 +166,7 @@ var groupSections_1 = require("../columnTypes/groupSections");
|
|
|
166
166
|
var chartResults_1 = require("../dataGraph/chartResults");
|
|
167
167
|
var defaultColours_1 = require("../columnTypes/defaultColours");
|
|
168
168
|
var systemColumns_1 = require("../columnTypes/systemColumns");
|
|
169
|
+
var dateFormat_1 = require("../columnTypes/dateFormat");
|
|
169
170
|
var dateRange_1 = require("../columnTypes/dateRange");
|
|
170
171
|
var lookup_1 = require("../columnTypes/lookup");
|
|
171
172
|
var socket_1 = require("./socket");
|
|
@@ -2158,6 +2159,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2158
2159
|
return (__assign(__assign({}, eachColumn), { hide: (_b = (_a = state.hiddenColumnIds) === null || _a === void 0 ? void 0 : _a.includes(eachColumn.id)) !== null && _b !== void 0 ? _b : false }));
|
|
2159
2160
|
}));
|
|
2160
2161
|
};
|
|
2162
|
+
// INFO: the format a date column's list text was written in, which the
|
|
2163
|
+
// calendar and timeline read it back with
|
|
2164
|
+
var handleFindColumnDateFormat = function (columnId) {
|
|
2165
|
+
return (0, dateFormat_1.handleGetColumnDateFormat)(structure.find(function (eachColumn) { return eachColumn.id === columnId; }));
|
|
2166
|
+
};
|
|
2161
2167
|
// INFO: the columns a list can be grouped by — the app's own list, else
|
|
2162
2168
|
// every column the reference picker offers, else the status, checkbox and
|
|
2163
2169
|
// person columns, monday's groupable kinds
|
|
@@ -4657,11 +4663,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4657
4663
|
}
|
|
4658
4664
|
};
|
|
4659
4665
|
var handleGetItemError = function (err) {
|
|
4660
|
-
var _a, _b, _c;
|
|
4661
|
-
|
|
4666
|
+
var _a, _b, _c, _d, _e;
|
|
4667
|
+
// INFO: a failed record read sends the page back to the list, which loads
|
|
4668
|
+
// afresh, so the table shows loading until it does. A failed list read is
|
|
4669
|
+
// finished — loading there kept the skeleton (and a bareListComponent's
|
|
4670
|
+
// loading flag) on for good
|
|
4671
|
+
var isRecordView = resolvedType === "update" || resolvedType === "read";
|
|
4672
|
+
setTableLoading(isRecordView);
|
|
4662
4673
|
setModalVisible(false);
|
|
4663
4674
|
setLoading(false);
|
|
4664
|
-
if (
|
|
4675
|
+
if (isRecordView) {
|
|
4665
4676
|
if ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate)
|
|
4666
4677
|
props.organise.handleNavigate("list", "");
|
|
4667
4678
|
}
|
|
@@ -4672,6 +4683,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4672
4683
|
: err.response.data.err);
|
|
4673
4684
|
else
|
|
4674
4685
|
console.log("Data Retrieval Error - " + err.message);
|
|
4686
|
+
// INFO: the page is told too, so it can show its own message or a retry
|
|
4687
|
+
(_e = (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListHandleError) === null || _e === void 0 ? void 0 : _e.call(_d, err);
|
|
4675
4688
|
setNotification({
|
|
4676
4689
|
title: "Data Retrieval Error",
|
|
4677
4690
|
type: false,
|
|
@@ -12206,16 +12219,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12206
12219
|
// one row without a date must not hide every row after it
|
|
12207
12220
|
if (!eachData[calendarSettings_1.startDate])
|
|
12208
12221
|
continue;
|
|
12209
|
-
else if (!(0,
|
|
12222
|
+
else if (!(0, dateFormat_1.handleParseListDate)(eachData[calendarSettings_1.startDate], handleFindColumnDateFormat(calendarSettings_1.startDate)).isValid()) {
|
|
12210
12223
|
continue;
|
|
12211
12224
|
}
|
|
12212
12225
|
else {
|
|
12213
12226
|
var id = eachData.id;
|
|
12214
12227
|
var title = (0, readModule_1.handleCutPreviewText)(eachData[calendarSettings_1.title]);
|
|
12215
|
-
var startDate = (0,
|
|
12228
|
+
var startDate = (0, dateFormat_1.handleParseListDate)(eachData[calendarSettings_1.startDate], handleFindColumnDateFormat(calendarSettings_1.startDate));
|
|
12216
12229
|
var endDate = calendarSettings_1.endDate &&
|
|
12217
12230
|
eachData[calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.endDate]
|
|
12218
|
-
? (0,
|
|
12231
|
+
? (0, dateFormat_1.handleParseListDate)(eachData[calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.endDate], handleFindColumnDateFormat(calendarSettings_1.endDate))
|
|
12219
12232
|
: startDate;
|
|
12220
12233
|
var eventAvailability = {
|
|
12221
12234
|
id: id,
|
|
@@ -12438,8 +12451,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12438
12451
|
// undated record in a union does not drop every bar after it
|
|
12439
12452
|
if (!rawStart || !rawEnd)
|
|
12440
12453
|
continue;
|
|
12441
|
-
var startDate = (0,
|
|
12442
|
-
var endDate = (0,
|
|
12454
|
+
var startDate = (0, dateFormat_1.handleParseListDate)(rawStart, handleFindColumnDateFormat(timelineSettings_1.startDate));
|
|
12455
|
+
var endDate = (0, dateFormat_1.handleParseListDate)(rawEnd, handleFindColumnDateFormat(timelineSettings_1.endDate));
|
|
12443
12456
|
if (!startDate.isValid() || !endDate.isValid())
|
|
12444
12457
|
continue;
|
|
12445
12458
|
var color = undefined;
|