@sme.up/doc-alchemist 1.0.0-SNAPSHOT-20250613190137 → 1.0.0-SNAPSHOT-20250616065929
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,10 +1,10 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
|
-
import "dayjs/locale/es";
|
|
3
|
-
import "dayjs/locale/fr";
|
|
4
|
-
import "dayjs/locale/it";
|
|
5
|
-
import "dayjs/locale/pl";
|
|
6
|
-
import "dayjs/locale/ru";
|
|
7
|
-
import "dayjs/locale/zh";
|
|
2
|
+
import "dayjs/locale/es.js";
|
|
3
|
+
import "dayjs/locale/fr.js";
|
|
4
|
+
import "dayjs/locale/it.js";
|
|
5
|
+
import "dayjs/locale/pl.js";
|
|
6
|
+
import "dayjs/locale/ru.js";
|
|
7
|
+
import "dayjs/locale/zh.js";
|
|
8
8
|
export declare const datesFormat: (input: dayjs.ConfigType, locale: string, format?: string) => string;
|
|
9
9
|
export declare const datesIsIsoDate: (dateString: string) => boolean;
|
|
10
10
|
export declare const datesToDate: (input: dayjs.ConfigType, locale: string, format?: string) => Date;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
|
-
import utc from "dayjs/plugin/utc";
|
|
3
|
-
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
4
|
-
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
5
|
-
import minMax from "dayjs/plugin/minMax";
|
|
6
|
-
import "dayjs/locale/es";
|
|
7
|
-
import "dayjs/locale/fr";
|
|
8
|
-
import "dayjs/locale/it";
|
|
9
|
-
import "dayjs/locale/pl";
|
|
10
|
-
import "dayjs/locale/ru";
|
|
11
|
-
import "dayjs/locale/zh";
|
|
2
|
+
import utc from "dayjs/plugin/utc.js";
|
|
3
|
+
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
4
|
+
import localizedFormat from "dayjs/plugin/localizedFormat.js";
|
|
5
|
+
import minMax from "dayjs/plugin/minMax.js";
|
|
6
|
+
import "dayjs/locale/es.js";
|
|
7
|
+
import "dayjs/locale/fr.js";
|
|
8
|
+
import "dayjs/locale/it.js";
|
|
9
|
+
import "dayjs/locale/pl.js";
|
|
10
|
+
import "dayjs/locale/ru.js";
|
|
11
|
+
import "dayjs/locale/zh.js";
|
|
12
12
|
import { DatesFormats } from "../types/index.js";
|
|
13
13
|
dayjs.extend(utc);
|
|
14
14
|
dayjs.extend(customParseFormat);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates-utility.js","sourceRoot":"","sources":["../../../src/utils/dates-utility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"dates-utility.js","sourceRoot":"","sources":["../../../src/utils/dates-utility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAClB,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAC9B,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAErB,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,KAAuB,EACvB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AAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB,IAAI,MAAM,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5C,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;IACpC,CAAC;AACH,CAAC,CAAC","sourcesContent":["import dayjs from \"dayjs\";\nimport utc from \"dayjs/plugin/utc.js\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat.js\";\nimport minMax from \"dayjs/plugin/minMax.js\";\nimport \"dayjs/locale/es.js\";\nimport \"dayjs/locale/fr.js\";\nimport \"dayjs/locale/it.js\";\nimport \"dayjs/locale/pl.js\";\nimport \"dayjs/locale/ru.js\";\nimport \"dayjs/locale/zh.js\";\nimport { DatesFormats } from \"../types/index.js\";\n\ndayjs.extend(utc);\ndayjs.extend(customParseFormat);\ndayjs.extend(localizedFormat);\ndayjs.extend(minMax);\n\nexport const datesFormat = (\n input: dayjs.ConfigType,\n locale: string,\n format?: string,\n): string => {\n const _dayjs = dayjs;\n _dayjs.locale(locale);\n if (!format) {\n format = \"L\"; // MM/DD/YYYY, DD/MM/YYYY depending on locale\n }\n return _dayjs.utc(input).format(format);\n};\n\nexport const datesIsIsoDate = (dateString: string): boolean => {\n const isoDate = dayjs(dateString, [\n DatesFormats.ISO_DATE,\n DatesFormats.ISO_DATE_TIME,\n \"YYYY-MM-DDTHH:mm:ss.SSSZ\",\n ]);\n if (!isoDate.isValid()) {\n return false;\n }\n\n if (Number(dateString.substring(0, 4)) != isoDate.year()) {\n return false;\n }\n if (Number(dateString.substring(5, 7)) != isoDate.month() + 1) {\n return false;\n }\n if (Number(dateString.substring(8, 10)) != isoDate.date()) {\n return false;\n }\n return true;\n};\n\nexport const datesToDate = (\n input: dayjs.ConfigType,\n locale: string,\n format?: string,\n): Date => {\n const _dayjs = dayjs;\n _dayjs.locale(locale);\n if (format && format != null) {\n return _dayjs.utc(input, format).toDate();\n } else {\n return _dayjs.utc(input).toDate();\n }\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sme.up/doc-alchemist",
|
|
3
|
-
"version": "1.0.0-SNAPSHOT-
|
|
3
|
+
"version": "1.0.0-SNAPSHOT-20250616065929",
|
|
4
4
|
"description": "Library for generating documents in various formats, including Excel and PDF.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Smeup LAB <info@smeup.com> (https://www.smeup.com/)",
|