@base-web-kits/base-tools-ts 1.3.10 → 1.3.12
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/base-tools-ts.umd.global.js +5 -0
- package/dist/base-tools-ts.umd.global.js.map +1 -1
- package/dist/day/index.d.ts +11 -0
- package/dist/day/index.d.ts.map +1 -1
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/url/oss/index.d.ts +8 -10
- package/dist/url/oss/index.d.ts.map +1 -1
- package/package.json +39 -39
- package/src/ts/day/index.ts +15 -0
- package/src/ts/url/oss/index.ts +9 -11
|
@@ -778,6 +778,7 @@ var baseToolsTS = (() => {
|
|
|
778
778
|
createViewRandId: () => createViewRandId,
|
|
779
779
|
curry: () => curry,
|
|
780
780
|
curryRight: () => curryRight,
|
|
781
|
+
dateFormat: () => dateFormat,
|
|
781
782
|
dayjs: () => import_dayjs.default,
|
|
782
783
|
debounce: () => debounce,
|
|
783
784
|
deburr: () => deburr,
|
|
@@ -5388,6 +5389,10 @@ var baseToolsTS = (() => {
|
|
|
5388
5389
|
}
|
|
5389
5390
|
return (0, import_dayjs.default)(t, fmt);
|
|
5390
5391
|
}
|
|
5392
|
+
function dateFormat(t, fmt = "YYYY-MM-DD HH:mm:ss") {
|
|
5393
|
+
if (!t) return "";
|
|
5394
|
+
return toDayjs(t).format(fmt);
|
|
5395
|
+
}
|
|
5391
5396
|
function getDateRangeBefore(offset, fmt = "YYYY-MM-DD") {
|
|
5392
5397
|
const now = toDayjs(Date.now());
|
|
5393
5398
|
const n = Math.max(0, Math.trunc(offset));
|