zzz-pc-view 0.0.12 → 0.0.13
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/package.json +1 -1
- package/src/index.es.js +119 -3
- package/src/index.umd.js +2 -2
- package/src/utils/Date/ZDate.d.ts +27 -0
|
@@ -553,5 +553,32 @@ export declare class ZDate extends Date {
|
|
|
553
553
|
* // 输出 1722539071887
|
|
554
554
|
*/
|
|
555
555
|
setByFormat(...args: WithoutFirstParams<typeof setDateByFormat>): number;
|
|
556
|
+
/**
|
|
557
|
+
* 获取两个时间之间的持续时间格式字符串。
|
|
558
|
+
*
|
|
559
|
+
* @param beginTime - 开始时间,可以是字符串、数字、Date 对象或 ZDate 对象。
|
|
560
|
+
* @param endTime - 结束时间,可以是字符串、数字、Date 对象或 ZDate 对象。
|
|
561
|
+
* @param lastEndIndex - 最后一个时间单位的索引,默认为 timeConfigs 数组的最后一个索引。
|
|
562
|
+
* @returns 持续时间的格式字符串。
|
|
563
|
+
*
|
|
564
|
+
* @example
|
|
565
|
+
const beginTime = new ZDate('2023/01/01 00:00:00')
|
|
566
|
+
const endTime = new ZDate('2023/01/01 00:00:05')
|
|
567
|
+
const durationStr = ZUtils.ZDate.getDurationFormatStr(beginTime, endTime)
|
|
568
|
+
console.log(durationStr)
|
|
569
|
+
*
|
|
570
|
+
* @example
|
|
571
|
+
const beginTime = new ZDate('2023/01/01 00:00:00')
|
|
572
|
+
const endTime = new ZDate('2023/01/01 00:05:00')
|
|
573
|
+
const durationStr = ZUtils.ZDate.getDurationFormatStr(beginTime, endTime, 2)
|
|
574
|
+
console.log(durationStr)
|
|
575
|
+
|
|
576
|
+
* @example
|
|
577
|
+
const beginTime = new ZDate('2023/01/01 00:00:00')
|
|
578
|
+
const endTime = new ZDate('2023/01/01 00:05:00')
|
|
579
|
+
const durationStr = ZUtils.ZDate.getDurationFormatStr(beginTime, endTime, -1)
|
|
580
|
+
console.log(durationStr)
|
|
581
|
+
*/
|
|
582
|
+
static getDurationFormatStr(beginTime: string | number | Date | ZDate, endTime: string | number | Date | ZDate, lastEndIndex?: number): string;
|
|
556
583
|
}
|
|
557
584
|
export {};
|