@pksep/zod-shared 0.0.512 → 0.0.513
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.
|
@@ -21,6 +21,14 @@ export declare class DateMethods {
|
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
23
|
comparison: (one_date?: string, two_date?: string, operation?: string) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Выссчитываем дельту двух дат.
|
|
26
|
+
* Результат возвращается в минутах
|
|
27
|
+
* @param calculatedCreateTime
|
|
28
|
+
* @param planReadyTime
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
calculateDeltaTime: (calculatedCreateTime: Date, planReadyTime: Date) => number;
|
|
24
32
|
/**
|
|
25
33
|
* Функция возвращает текущее время в UTC формате
|
|
26
34
|
* @param config
|
|
@@ -47,6 +47,19 @@ class DateMethods {
|
|
|
47
47
|
}
|
|
48
48
|
return result;
|
|
49
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Выссчитываем дельту двух дат.
|
|
52
|
+
* Результат возвращается в минутах
|
|
53
|
+
* @param calculatedCreateTime
|
|
54
|
+
* @param planReadyTime
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
this.calculateDeltaTime = (calculatedCreateTime, planReadyTime) => {
|
|
58
|
+
const calculateDate = new Date(calculatedCreateTime);
|
|
59
|
+
const planReadyDate = new Date(planReadyTime);
|
|
60
|
+
const diffInMs = planReadyDate.getTime() - calculateDate.getTime();
|
|
61
|
+
return Math.round(diffInMs / (1000 * 60));
|
|
62
|
+
};
|
|
50
63
|
/**
|
|
51
64
|
* Функция возвращает текущее время в UTC формате
|
|
52
65
|
* @param config
|