@uxf/core 11.100.0 → 11.107.0
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/date/is-time-string.test.js +1 -1
- package/date/to-time-string.test.js +1 -1
- package/money/get-currency-symbol.d.ts +1 -1
- package/package.json +1 -1
- package/date/to-date-string.d.ts +0 -5
- package/date/to-date-string.js +0 -10
- package/date/to-date-string.test.d.ts +0 -1
- package/date/to-date-string.test.js +0 -7
- package/date/to-datetime-string.d.ts +0 -5
- package/date/to-datetime-string.js +0 -20
- package/date/to-datetime-string.test.d.ts +0 -1
- package/date/to-datetime-string.test.js +0 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const is_time_string_1 = require("./is-time-string");
|
|
4
|
-
test("
|
|
4
|
+
test("isTimeString", () => {
|
|
5
5
|
expect((0, is_time_string_1.isTimeString)("00:00:00")).toBe(true);
|
|
6
6
|
expect((0, is_time_string_1.isTimeString)("12:30:30")).toBe(true);
|
|
7
7
|
expect((0, is_time_string_1.isTimeString)("23:59:59")).toBe(true);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const to_time_string_1 = require("./to-time-string");
|
|
4
|
-
test("
|
|
4
|
+
test("toTimeString", () => {
|
|
5
5
|
expect((0, to_time_string_1.toTimeString)(new Date("2024-01-01 01:01:01"))).toBe("01:01:01");
|
|
6
6
|
expect((0, to_time_string_1.toTimeString)(new Date("2024-01-01 20:15:30"))).toBe("20:15:30");
|
|
7
7
|
expect((0, to_time_string_1.toTimeString)(new Date("2024-01-01 23:59:59"))).toBe("23:59:59");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Currency } from "
|
|
1
|
+
import { Currency } from "./index";
|
|
2
2
|
export declare const getCurrencySymbol: (currency: Currency) => "" | "د.إ" | "؋" | "֏" | "ƒ" | "$" | "₼" | "৳" | "лв" | ".د.ب" | "FBu" | "R$" | "Nu." | "Br" | "CHF" | "¥" | "₡" | "₱" | "Kč" | "Fdj" | "kr" | "£" | "Nfk" | "€" | "₾" | "D" | "FG" | "G" | "Ft" | "Rp" | "₹" | "ع.د" | "с" | "៛" | "CF" | "₩" | "د.ك" | "₸" | "₨" | "L" | "K" | "₮" | "MK" | "RM" | "MT" | "₦" | "S/" | "zł" | "₲" | "lei" | "дин." | "₽" | "ج.س." | "Le" | "E" | "฿" | "ЅМ" | "m" | "₺" | "Sh" | "USh" | "soʻm" | "Bs" | "₫" | "VT" | "T" | "CFA" | "₣" | "﷼" | "R" | "ZK";
|
package/package.json
CHANGED
package/date/to-date-string.d.ts
DELETED
package/date/to-date-string.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toDateString = toDateString;
|
|
4
|
-
const is_nil_1 = require("../utils/is-nil");
|
|
5
|
-
function toDateString(value) {
|
|
6
|
-
if ((0, is_nil_1.isNil)(value)) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
return value.toISOString().substring(0, 10);
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const to_date_string_1 = require("./to-date-string");
|
|
4
|
-
test("toDateString", () => {
|
|
5
|
-
expect((0, to_date_string_1.toDateString)(new Date("2024-10-30 12:00:00"))).toBe("2024-10-30");
|
|
6
|
-
expect((0, to_date_string_1.toDateString)(new Date("2300-01-01 12:00:00"))).toBe("2300-01-01");
|
|
7
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { DatetimeString } from "./index";
|
|
2
|
-
type InputType = Date | null;
|
|
3
|
-
type ReturnType<T extends InputType> = T extends null ? DatetimeString | null : DatetimeString;
|
|
4
|
-
export declare function toDatetimeString<T extends InputType>(value: T): ReturnType<T>;
|
|
5
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toDatetimeString = toDatetimeString;
|
|
4
|
-
const is_nil_1 = require("../utils/is-nil");
|
|
5
|
-
function toDatetimeString(value) {
|
|
6
|
-
if ((0, is_nil_1.isNil)(value)) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
const month = String(value.getMonth() + 1).padStart(2, "0");
|
|
10
|
-
const day = String(value.getDate()).padStart(2, "0");
|
|
11
|
-
const hours = String(value.getHours()).padStart(2, "0");
|
|
12
|
-
const minutes = String(value.getMinutes()).padStart(2, "0");
|
|
13
|
-
const seconds = String(value.getSeconds()).padStart(2, "0");
|
|
14
|
-
const timezoneOffset = -value.getTimezoneOffset();
|
|
15
|
-
const offsetHours = String(Math.floor(Math.abs(timezoneOffset) / 60)).padStart(2, "0");
|
|
16
|
-
const offsetMinutes = String(Math.abs(timezoneOffset) % 60).padStart(2, "0");
|
|
17
|
-
const offsetSign = timezoneOffset >= 0 ? "+" : "-";
|
|
18
|
-
const timezone = `${offsetSign}${offsetHours}:${offsetMinutes}`;
|
|
19
|
-
return `${value.getFullYear()}-${month}-${day}T${hours}:${minutes}:${seconds}${timezone}`;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const to_datetime_string_1 = require("./to-datetime-string");
|
|
4
|
-
test("toDatetimeString", () => {
|
|
5
|
-
const oldTimezoneFunction = Date.prototype.getTimezoneOffset;
|
|
6
|
-
Date.prototype.getTimezoneOffset = () => -60;
|
|
7
|
-
expect((0, to_datetime_string_1.toDatetimeString)(new Date("2024-01-01 20:15:30"))).toBe("2024-01-01T20:15:30+01:00");
|
|
8
|
-
Date.prototype.getTimezoneOffset = () => -120;
|
|
9
|
-
expect((0, to_datetime_string_1.toDatetimeString)(new Date("2024-08-01 20:15:30"))).toBe("2024-08-01T20:15:30+02:00");
|
|
10
|
-
expect((0, to_datetime_string_1.toDatetimeString)(new Date("2024-08-01 23:59:59"))).toBe("2024-08-01T23:59:59+02:00");
|
|
11
|
-
Date.prototype.getTimezoneOffset = () => -150;
|
|
12
|
-
expect((0, to_datetime_string_1.toDatetimeString)(new Date("2024-01-01 12:00:00"))).toBe("2024-01-01T12:00:00+02:30");
|
|
13
|
-
Date.prototype.getTimezoneOffset = oldTimezoneFunction;
|
|
14
|
-
});
|