@lyxa.ai/core 1.2.96-beta.2 → 1.2.96-beta.3
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
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/types",
|
|
3
|
-
"version": "1.2.96-beta.
|
|
3
|
+
"version": "1.2.96-beta.3",
|
|
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",
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
|
|
1
|
+
import dayjs, { Dayjs } from 'dayjs';
|
|
2
|
+
type DayjsWithTimezone = {
|
|
3
|
+
(date?: any, format?: any, tz?: string): Dayjs;
|
|
4
|
+
setTimezone(timezone: string): void;
|
|
5
|
+
getTimezone(): string;
|
|
6
|
+
} & typeof dayjs;
|
|
7
|
+
declare const dayjsWithTimezone: DayjsWithTimezone;
|
|
3
8
|
export declare const _setTimezone: (timezone: string) => void;
|
|
4
9
|
export default dayjsWithTimezone;
|
|
@@ -10,23 +10,23 @@ const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
|
10
10
|
dayjs_1.default.extend(utc_1.default);
|
|
11
11
|
dayjs_1.default.extend(timezone_1.default);
|
|
12
12
|
let DEFAULT_TIMEZONE = 'Asia/Beirut';
|
|
13
|
-
const dayjsWithTimezone = (date, format, tz) => {
|
|
13
|
+
const dayjsWithTimezone = ((date, format, tz) => {
|
|
14
14
|
const targetTimezone = tz || DEFAULT_TIMEZONE;
|
|
15
15
|
if (format) {
|
|
16
16
|
return (0, dayjs_1.default)(date, format).tz(targetTimezone);
|
|
17
17
|
}
|
|
18
18
|
return (0, dayjs_1.default)(date).tz(targetTimezone);
|
|
19
|
-
};
|
|
19
|
+
});
|
|
20
20
|
Object.keys(dayjs_1.default).forEach(key => {
|
|
21
21
|
dayjsWithTimezone[key] = dayjs_1.default[key];
|
|
22
22
|
});
|
|
23
|
-
const _setTimezone = (timezone) => {
|
|
24
|
-
DEFAULT_TIMEZONE = timezone;
|
|
25
|
-
};
|
|
26
|
-
exports._setTimezone = _setTimezone;
|
|
27
23
|
dayjsWithTimezone.setTimezone = (timezone) => {
|
|
28
24
|
DEFAULT_TIMEZONE = timezone;
|
|
29
25
|
};
|
|
30
26
|
dayjsWithTimezone.getTimezone = () => DEFAULT_TIMEZONE;
|
|
27
|
+
const _setTimezone = (timezone) => {
|
|
28
|
+
DEFAULT_TIMEZONE = timezone;
|
|
29
|
+
};
|
|
30
|
+
exports._setTimezone = _setTimezone;
|
|
31
31
|
exports.default = dayjsWithTimezone;
|
|
32
32
|
//# sourceMappingURL=dayjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dayjs.js","sourceRoot":"/","sources":["utilities/dayjs/dayjs.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqC;AACrC,2DAAmC;AACnC,qEAA6C;AAE7C,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAClB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAEvB,IAAI,gBAAgB,GAAG,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"dayjs.js","sourceRoot":"/","sources":["utilities/dayjs/dayjs.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqC;AACrC,2DAAmC;AACnC,qEAA6C;AAE7C,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAClB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAEvB,IAAI,gBAAgB,GAAG,aAAa,CAAC;AAQrC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAU,EAAE,MAAY,EAAE,EAAW,EAAE,EAAE;IACnE,MAAM,cAAc,GAAG,EAAE,IAAI,gBAAgB,CAAC;IAC9C,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,CAAsB,CAAC;AAExB,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;AAEH,iBAAiB,CAAC,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE;IACnD,gBAAgB,GAAG,QAAQ,CAAC;AAC9B,CAAC,CAAC;AAEF,iBAAiB,CAAC,WAAW,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC;AAEhD,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,EAAE;IAC/C,gBAAgB,GAAG,QAAQ,CAAC;AAC9B,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF,kBAAe,iBAAiB,CAAC","sourcesContent":["import dayjs, { Dayjs } from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\nlet DEFAULT_TIMEZONE = 'Asia/Beirut';\n\ntype DayjsWithTimezone = {\n (date?: any, format?: any, tz?: string): Dayjs;\n setTimezone(timezone: string): void;\n getTimezone(): string;\n} & typeof dayjs;\n\nconst dayjsWithTimezone = ((date?: any, format?: any, tz?: string) => {\n const targetTimezone = tz || DEFAULT_TIMEZONE;\n if (format) {\n return dayjs(date, format).tz(targetTimezone);\n }\n return dayjs(date).tz(targetTimezone);\n}) as DayjsWithTimezone;\n\nObject.keys(dayjs).forEach(key => {\n (dayjsWithTimezone as any)[key] = (dayjs as any)[key];\n});\n\ndayjsWithTimezone.setTimezone = (timezone: string) => {\n DEFAULT_TIMEZONE = timezone;\n};\n\ndayjsWithTimezone.getTimezone = () => DEFAULT_TIMEZONE;\n\nexport const _setTimezone = (timezone: string) => {\n DEFAULT_TIMEZONE = timezone;\n};\n\nexport default dayjsWithTimezone;"]}
|