@lyxa.ai/core 1.2.93-beta.0 → 1.2.93-beta.1
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/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/utilities/dayjs/dayjs.d.ts +3 -0
- package/dist/utilities/dayjs/dayjs.js +29 -0
- package/dist/utilities/dayjs/dayjs.js.map +1 -0
- package/dist/utilities/dayjs/index.d.ts +1 -3
- package/dist/utilities/dayjs/index.js +3 -23
- package/dist/utilities/dayjs/index.js.map +1 -1
- package/package.json +1 -1
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/types",
|
|
3
|
-
"version": "1.2.93-beta.
|
|
3
|
+
"version": "1.2.93-beta.1",
|
|
4
4
|
"description": "Lyxa type definitions and validation schemas for both frontend and backend",
|
|
5
5
|
"author": "elie <42282499+Internalizable@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
7
|
+
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
8
|
+
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
9
|
+
dayjs_1.default.extend(utc_1.default);
|
|
10
|
+
dayjs_1.default.extend(timezone_1.default);
|
|
11
|
+
let DEFAULT_TIMEZONE = process.env.TIMEZONE || 'UTC';
|
|
12
|
+
const dayjsWithTimezone = (date, format, tz) => {
|
|
13
|
+
const targetTimezone = tz || DEFAULT_TIMEZONE;
|
|
14
|
+
if (format) {
|
|
15
|
+
return (0, dayjs_1.default)(date, format).tz(targetTimezone);
|
|
16
|
+
}
|
|
17
|
+
return (0, dayjs_1.default)(date).tz(targetTimezone);
|
|
18
|
+
};
|
|
19
|
+
Object.keys(dayjs_1.default).forEach(key => {
|
|
20
|
+
dayjsWithTimezone[key] = dayjs_1.default[key];
|
|
21
|
+
});
|
|
22
|
+
dayjsWithTimezone.setDefaultTimezone = (timezone) => {
|
|
23
|
+
DEFAULT_TIMEZONE = timezone;
|
|
24
|
+
};
|
|
25
|
+
dayjsWithTimezone.getDefaultTimezone = () => {
|
|
26
|
+
return DEFAULT_TIMEZONE;
|
|
27
|
+
};
|
|
28
|
+
exports.default = dayjsWithTimezone;
|
|
29
|
+
//# sourceMappingURL=dayjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayjs.js","sourceRoot":"/","sources":["utilities/dayjs/dayjs.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,2DAAmC;AACnC,qEAA6C;AAG7C,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAClB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAGvB,IAAI,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,KAAK,CAAC;AAGrD,MAAM,iBAAiB,GAAG,CAAC,IAAU,EAAE,MAAY,EAAE,EAAW,EAAE,EAAE;IAClE,MAAM,cAAc,GAAG,EAAE,IAAI,gBAAgB,CAAC;IAE9C,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,IAAA,eAAK,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC;AACxC,CAAC,CAAC;AAGF,MAAM,CAAC,IAAI,CAAC,eAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;IAC9B,iBAAyB,CAAC,GAAG,CAAC,GAAI,eAAa,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC;AAGF,iBAAyB,CAAC,kBAAkB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACnE,gBAAgB,GAAG,QAAQ,CAAC;AAC9B,CAAC,CAAC;AAGD,iBAAyB,CAAC,kBAAkB,GAAG,GAAG,EAAE;IACnD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC","sourcesContent":["import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\n\n// Extend dayjs with timezone support\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\n// Set default timezone (change as needed)\nlet DEFAULT_TIMEZONE = process.env.TIMEZONE || 'UTC';\n\n// Override the default dayjs to support optional timezone parameter\nconst dayjsWithTimezone = (date?: any, format?: any, tz?: string) => {\n const targetTimezone = tz || DEFAULT_TIMEZONE;\n \n if (format) {\n return dayjs(date, format).tz(targetTimezone);\n }\n return dayjs(date).tz(targetTimezone);\n};\n\n// Copy all static methods from dayjs\nObject.keys(dayjs).forEach(key => {\n (dayjsWithTimezone as any)[key] = (dayjs as any)[key];\n});\n\n// Add method to set default timezone\n(dayjsWithTimezone as any).setDefaultTimezone = (timezone: string) => {\n DEFAULT_TIMEZONE = timezone;\n};\n\n// Add method to get default timezone\n(dayjsWithTimezone as any).getDefaultTimezone = () => {\n return DEFAULT_TIMEZONE;\n};\n\nexport default dayjsWithTimezone;"]}
|
|
@@ -3,27 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
dayjs_1.default.extend(utc_1.default);
|
|
10
|
-
dayjs_1.default.extend(timezone_1.default);
|
|
11
|
-
let DEFAULT_TIMEZONE = process.env.TIMEZONE || 'UTC';
|
|
12
|
-
const dayjsWithTimezone = (date, format, tz) => {
|
|
13
|
-
const targetTimezone = tz || DEFAULT_TIMEZONE;
|
|
14
|
-
if (format) {
|
|
15
|
-
return (0, dayjs_1.default)(date, format).tz(targetTimezone);
|
|
16
|
-
}
|
|
17
|
-
return (0, dayjs_1.default)(date).tz(targetTimezone);
|
|
18
|
-
};
|
|
19
|
-
Object.keys(dayjs_1.default).forEach(key => {
|
|
20
|
-
dayjsWithTimezone[key] = dayjs_1.default[key];
|
|
21
|
-
});
|
|
22
|
-
dayjsWithTimezone.setDefaultTimezone = (timezone) => {
|
|
23
|
-
DEFAULT_TIMEZONE = timezone;
|
|
24
|
-
};
|
|
25
|
-
dayjsWithTimezone.getDefaultTimezone = () => {
|
|
26
|
-
return DEFAULT_TIMEZONE;
|
|
27
|
-
};
|
|
28
|
-
exports.default = dayjsWithTimezone;
|
|
6
|
+
exports.dayjs = void 0;
|
|
7
|
+
var dayjs_1 = require("./dayjs");
|
|
8
|
+
Object.defineProperty(exports, "dayjs", { enumerable: true, get: function () { return __importDefault(dayjs_1).default; } });
|
|
29
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["utilities/dayjs/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["utilities/dayjs/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAA2C;AAAlC,+GAAA,OAAO,OAAS","sourcesContent":["export { default as dayjs } from './dayjs';\n"]}
|