cx 24.11.4 → 25.1.1
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.js +18 -17
- package/dist/data.js +11 -3
- package/dist/manifest.js +845 -836
- package/dist/ui.js +5 -4
- package/dist/util.js +40 -10
- package/dist/widgets.js +50 -34
- package/package.json +1 -1
- package/src/charts/axis/TimeAxis.js +18 -17
- package/src/data/Expression.js +9 -1
- package/src/data/Expression.spec.js +12 -0
- package/src/data/StringTemplate.js +92 -92
- package/src/data/StringTemplate.spec.js +22 -0
- package/src/ui/Culture.d.ts +2 -0
- package/src/ui/Format.js +108 -107
- package/src/ui/HoverSync.js +147 -147
- package/src/util/Format.js +3 -2
- package/src/util/date/encodeDate.d.ts +1 -0
- package/src/util/date/encodeDate.js +8 -0
- package/src/util/date/encodeDateWithTimezoneOffset.d.ts +1 -1
- package/src/util/date/index.d.ts +11 -9
- package/src/util/date/index.js +11 -9
- package/src/util/date/parseDateInvariant.d.ts +3 -0
- package/src/util/date/parseDateInvariant.js +20 -0
- package/src/widgets/form/Calendar.js +618 -617
- package/src/widgets/form/DateTimeField.js +8 -5
- package/src/widgets/form/DateTimePicker.js +392 -391
- package/src/widgets/form/MonthField.d.ts +99 -95
- package/src/widgets/form/MonthField.js +16 -9
- package/src/widgets/form/MonthPicker.d.ts +76 -74
- package/src/widgets/form/MonthPicker.js +640 -632
- package/src/widgets/grid/Grid.d.ts +1 -1
- package/src/widgets/grid/Grid.js +3414 -3413
- package/src/widgets/grid/GridRow.js +228 -228
|
@@ -27,6 +27,7 @@ import { Format } from "../../util/Format";
|
|
|
27
27
|
import { TimeList } from "./TimeList";
|
|
28
28
|
import { autoFocus } from "../autoFocus";
|
|
29
29
|
import { getActiveElement } from "../../util";
|
|
30
|
+
import { parseDateInvariant } from "../../util";
|
|
30
31
|
|
|
31
32
|
export class DateTimeField extends Field {
|
|
32
33
|
declareData() {
|
|
@@ -77,7 +78,9 @@ export class DateTimeField extends Field {
|
|
|
77
78
|
let { data } = instance;
|
|
78
79
|
|
|
79
80
|
if (data.value) {
|
|
80
|
-
let date =
|
|
81
|
+
let date = parseDateInvariant(data.value);
|
|
82
|
+
// let date = new Date(data.value);
|
|
83
|
+
|
|
81
84
|
if (isNaN(date.getTime())) data.formatted = String(data.value);
|
|
82
85
|
else {
|
|
83
86
|
// handle utc edge cases
|
|
@@ -87,11 +90,11 @@ export class DateTimeField extends Field {
|
|
|
87
90
|
data.date = date;
|
|
88
91
|
} else data.formatted = "";
|
|
89
92
|
|
|
90
|
-
if (data.refDate) data.refDate = zeroTime(
|
|
93
|
+
if (data.refDate) data.refDate = zeroTime(parseDateInvariant(data.refDate));
|
|
91
94
|
|
|
92
|
-
if (data.maxValue) data.maxValue =
|
|
95
|
+
if (data.maxValue) data.maxValue = parseDateInvariant(data.maxValue);
|
|
93
96
|
|
|
94
|
-
if (data.minValue) data.minValue =
|
|
97
|
+
if (data.minValue) data.minValue = parseDateInvariant(data.minValue);
|
|
95
98
|
|
|
96
99
|
if (this.segment == "date") {
|
|
97
100
|
if (data.minValue) data.minValue = zeroTime(data.minValue);
|
|
@@ -540,7 +543,7 @@ class DateTimeInput extends VDOM.Component {
|
|
|
540
543
|
});
|
|
541
544
|
|
|
542
545
|
if (!isNaN(date)) {
|
|
543
|
-
let mixed =
|
|
546
|
+
let mixed = parseDateInvariant(baseValue);
|
|
544
547
|
if (date && baseValue && !isNaN(mixed) && widget.partial) {
|
|
545
548
|
switch (widget.segment) {
|
|
546
549
|
case "date":
|