@pisell/date-picker 1.0.64 → 1.0.65
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/es/ActionBar/index.js
CHANGED
|
@@ -41,14 +41,14 @@ var ActionBar = function ActionBar(props) {
|
|
|
41
41
|
var _start$set, _start$set$set;
|
|
42
42
|
var newValue = _toConsumableArray(value);
|
|
43
43
|
var start = newValue[0] || dayjs();
|
|
44
|
-
newValue[0] = (start === null || start === void 0 ? void 0 : (_start$set = start.set("hour", val === null || val === void 0 ? void 0 : val.get("hour"))) === null || _start$set === void 0 ? void 0 : (_start$set$set = _start$set.set("minute", val === null || val === void 0 ? void 0 : val.get("minute"))) === null || _start$set$set === void 0 ? void 0 : _start$set$set.set("second", val === null || val === void 0 ? void 0 : val.get("second"))) || null;
|
|
44
|
+
newValue[0] = (start === null || start === void 0 ? void 0 : (_start$set = start.set("hour", (val === null || val === void 0 ? void 0 : val.get("hour")) || 0)) === null || _start$set === void 0 ? void 0 : (_start$set$set = _start$set.set("minute", (val === null || val === void 0 ? void 0 : val.get("minute")) || 0)) === null || _start$set$set === void 0 ? void 0 : _start$set$set.set("second", (val === null || val === void 0 ? void 0 : val.get("second")) || 0)) || null;
|
|
45
45
|
onChange(newValue, "time");
|
|
46
46
|
};
|
|
47
47
|
var handleEndChange = function handleEndChange(val) {
|
|
48
48
|
var _end$set, _end$set$set;
|
|
49
49
|
var newValue = _toConsumableArray(value);
|
|
50
50
|
var end = newValue[1] || dayjs();
|
|
51
|
-
newValue[1] = (end === null || end === void 0 ? void 0 : (_end$set = end.set("hour", val === null || val === void 0 ? void 0 : val.get("hour"))) === null || _end$set === void 0 ? void 0 : (_end$set$set = _end$set.set("minute", val === null || val === void 0 ? void 0 : val.get("minute"))) === null || _end$set$set === void 0 ? void 0 : _end$set$set.set("second", val === null || val === void 0 ? void 0 : val.get("second"))) || null;
|
|
51
|
+
newValue[1] = (end === null || end === void 0 ? void 0 : (_end$set = end.set("hour", (val === null || val === void 0 ? void 0 : val.get("hour")) || 0)) === null || _end$set === void 0 ? void 0 : (_end$set$set = _end$set.set("minute", (val === null || val === void 0 ? void 0 : val.get("minute")) || 0)) === null || _end$set$set === void 0 ? void 0 : _end$set$set.set("second", (val === null || val === void 0 ? void 0 : val.get("second")) || 0)) || null;
|
|
52
52
|
onChange(newValue, "time");
|
|
53
53
|
};
|
|
54
54
|
var spaceStyle = useMemo(function () {
|
|
@@ -2,6 +2,9 @@ import { Dayjs } from "dayjs";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ButtonProps } from "antd";
|
|
4
4
|
import { PresetType } from "../Shortcuts";
|
|
5
|
+
import 'dayjs/locale/zh-cn';
|
|
6
|
+
import 'dayjs/locale/en';
|
|
7
|
+
import 'dayjs/locale/zh-tw';
|
|
5
8
|
import "./index.less";
|
|
6
9
|
export interface PisellDateRangePickerProps {
|
|
7
10
|
/** 再次选择日期时是否清除结束时间 */
|
|
@@ -13,6 +13,9 @@ import classNames from "classnames";
|
|
|
13
13
|
import { isArr, isBoolean } from "@pisell/utils";
|
|
14
14
|
import useCssVariables from "./useCssVariables";
|
|
15
15
|
import CloseCircle from "./CloseCircle";
|
|
16
|
+
import 'dayjs/locale/zh-cn';
|
|
17
|
+
import 'dayjs/locale/en';
|
|
18
|
+
import 'dayjs/locale/zh-tw';
|
|
16
19
|
import "./index.less";
|
|
17
20
|
var transDayjsArr = function transDayjsArr(dayjsArr, defaultValue) {
|
|
18
21
|
var _newArr;
|
package/lib/ActionBar/index.js
CHANGED
|
@@ -62,14 +62,14 @@ var ActionBar = (props) => {
|
|
|
62
62
|
var _a, _b;
|
|
63
63
|
const newValue = [...value];
|
|
64
64
|
const start = newValue[0] || (0, import_dayjs.default)();
|
|
65
|
-
newValue[0] = ((_b = (_a = start == null ? void 0 : start.set("hour", val == null ? void 0 : val.get("hour"))) == null ? void 0 : _a.set("minute", val == null ? void 0 : val.get("minute"))) == null ? void 0 : _b.set("second", val == null ? void 0 : val.get("second"))) || null;
|
|
65
|
+
newValue[0] = ((_b = (_a = start == null ? void 0 : start.set("hour", (val == null ? void 0 : val.get("hour")) || 0)) == null ? void 0 : _a.set("minute", (val == null ? void 0 : val.get("minute")) || 0)) == null ? void 0 : _b.set("second", (val == null ? void 0 : val.get("second")) || 0)) || null;
|
|
66
66
|
onChange(newValue, "time");
|
|
67
67
|
};
|
|
68
68
|
const handleEndChange = (val) => {
|
|
69
69
|
var _a, _b;
|
|
70
70
|
const newValue = [...value];
|
|
71
71
|
const end = newValue[1] || (0, import_dayjs.default)();
|
|
72
|
-
newValue[1] = ((_b = (_a = end == null ? void 0 : end.set("hour", val == null ? void 0 : val.get("hour"))) == null ? void 0 : _a.set("minute", val == null ? void 0 : val.get("minute"))) == null ? void 0 : _b.set("second", val == null ? void 0 : val.get("second"))) || null;
|
|
72
|
+
newValue[1] = ((_b = (_a = end == null ? void 0 : end.set("hour", (val == null ? void 0 : val.get("hour")) || 0)) == null ? void 0 : _a.set("minute", (val == null ? void 0 : val.get("minute")) || 0)) == null ? void 0 : _b.set("second", (val == null ? void 0 : val.get("second")) || 0)) || null;
|
|
73
73
|
onChange(newValue, "time");
|
|
74
74
|
};
|
|
75
75
|
const spaceStyle = (0, import_react.useMemo)(() => {
|
|
@@ -2,6 +2,9 @@ import { Dayjs } from "dayjs";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ButtonProps } from "antd";
|
|
4
4
|
import { PresetType } from "../Shortcuts";
|
|
5
|
+
import 'dayjs/locale/zh-cn';
|
|
6
|
+
import 'dayjs/locale/en';
|
|
7
|
+
import 'dayjs/locale/zh-tw';
|
|
5
8
|
import "./index.less";
|
|
6
9
|
export interface PisellDateRangePickerProps {
|
|
7
10
|
/** 再次选择日期时是否清除结束时间 */
|
|
@@ -41,6 +41,9 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
41
41
|
var import_utils = require("@pisell/utils");
|
|
42
42
|
var import_useCssVariables = __toESM(require("./useCssVariables"));
|
|
43
43
|
var import_CloseCircle = __toESM(require("./CloseCircle"));
|
|
44
|
+
var import_zh_cn = require("dayjs/locale/zh-cn");
|
|
45
|
+
var import_en = require("dayjs/locale/en");
|
|
46
|
+
var import_zh_tw = require("dayjs/locale/zh-tw");
|
|
44
47
|
var import_index = require("./index.less");
|
|
45
48
|
var transDayjsArr = (dayjsArr, defaultValue) => {
|
|
46
49
|
let newArr = dayjsArr || defaultValue;
|