@nocobase/utils 1.5.0-beta.18 → 1.5.0-beta.19
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/date.d.ts +1 -0
- package/lib/date.js +11 -0
- package/package.json +2 -2
package/lib/date.d.ts
CHANGED
|
@@ -36,3 +36,4 @@ export declare const moment2str: (value?: dayjs.Dayjs, options?: Moment2strOptio
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function offsetFromString(string: string | number): number;
|
|
38
38
|
export declare const getPickerFormat: (picker: any) => "YYYY-MM" | "YYYY" | "YYYY[W]W" | "YYYY-MM-DD" | "YYYY[Q]Q";
|
|
39
|
+
export declare const getDateTimeFormat: (picker: any, format: any, showTime: any, timeFormat: any) => any;
|
package/lib/date.js
CHANGED
|
@@ -37,6 +37,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
37
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
38
|
var date_exports = {};
|
|
39
39
|
__export(date_exports, {
|
|
40
|
+
getDateTimeFormat: () => getDateTimeFormat,
|
|
40
41
|
getDefaultFormat: () => getDefaultFormat,
|
|
41
42
|
getPickerFormat: () => getPickerFormat,
|
|
42
43
|
moment2str: () => moment2str,
|
|
@@ -205,8 +206,18 @@ const getPickerFormat = /* @__PURE__ */ __name((picker) => {
|
|
|
205
206
|
return "YYYY-MM-DD";
|
|
206
207
|
}
|
|
207
208
|
}, "getPickerFormat");
|
|
209
|
+
const getDateTimeFormat = /* @__PURE__ */ __name((picker, format, showTime, timeFormat) => {
|
|
210
|
+
if (picker === "date") {
|
|
211
|
+
if (showTime) {
|
|
212
|
+
return format + timeFormat || "HH:mm:ss";
|
|
213
|
+
}
|
|
214
|
+
return format;
|
|
215
|
+
}
|
|
216
|
+
return format;
|
|
217
|
+
}, "getDateTimeFormat");
|
|
208
218
|
// Annotate the CommonJS export names for ESM import in node:
|
|
209
219
|
0 && (module.exports = {
|
|
220
|
+
getDateTimeFormat,
|
|
210
221
|
getDefaultFormat,
|
|
211
222
|
getPickerFormat,
|
|
212
223
|
moment2str,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/utils",
|
|
3
|
-
"version": "1.5.0-beta.
|
|
3
|
+
"version": "1.5.0-beta.19",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"multer": "^1.4.5-lts.1",
|
|
17
17
|
"object-path": "^0.11.8"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "a564836d60b070f0ba1fcc0fb6a2a5c647675e13"
|
|
20
20
|
}
|