mhz-helpers 1.4.21 → 1.4.22

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.
@@ -1,7 +1,7 @@
1
1
  import { TLocale } from '../locales/types';
2
2
  type TDate = string | Date | null;
3
3
  export declare function addZero(value: number): string;
4
- export declare function formatDuration(duration?: number, lang?: TLocale): string;
4
+ export declare function formatDuration(duration?: number, lang?: TLocale, isHideSeconds?: boolean): string;
5
5
  export declare function formatDate(dateRaw?: TDate, lang?: TLocale): string;
6
6
  export declare function formatDateTime(dateRaw?: TDate, lang?: TLocale): string;
7
7
  export declare function subtractDates(dateFuture?: TDate, datePast?: TDate, lang?: TLocale, isRawResult?: boolean): string | number;
@@ -3,10 +3,10 @@ import { t as e } from "../locales-Ca6po4UV.js";
3
3
  function t(e) {
4
4
  return e < 10 ? `0${e}` : `${e}`;
5
5
  }
6
- function n(n, r = "ru") {
6
+ function n(n, r = "ru", i) {
7
7
  if (!n || n < 0) return "0";
8
- let i = Math.floor(n / 60), a = n % 60;
9
- return `${i ? `${i} ${e[r].min}. ` : ""}${t(a)} ${e[r].sec}.`;
8
+ let a = Math.floor(n / 60), o = n % 60, s = a ? `${a} ${e[r].min}.` : "";
9
+ return i ? `${s}` : `${s} ${t(o)} ${e[r].sec}.`.trim();
10
10
  }
11
11
  function r(t, n = "ru") {
12
12
  return !t || Number.isNaN(new Date(t).getTime()) ? "0" : new Intl.DateTimeFormat(e[n].locale, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mhz-helpers",
3
3
  "description": "Mhz helpers and composables",
4
- "version": "1.4.21",
4
+ "version": "1.4.22",
5
5
  "author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -57,7 +57,7 @@
57
57
  "stylelint-prettier": "5.0.3",
58
58
  "typescript": "6.0.2",
59
59
  "typescript-eslint": "8.58.0",
60
- "vite": "8.0.3",
60
+ "vite": "8.0.5",
61
61
  "vite-plugin-dts": "4.5.4",
62
62
  "vitest": "4.1.2",
63
63
  "vue-eslint-parser": "10.4.0",