@akinon/akidate 0.4.0 → 0.4.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.
@@ -0,0 +1,14 @@
1
+ import 'dayjs/locale/ar';
2
+ import 'dayjs/locale/de';
3
+ import 'dayjs/locale/en';
4
+ import 'dayjs/locale/es';
5
+ import 'dayjs/locale/fr';
6
+ import 'dayjs/locale/pt';
7
+ import 'dayjs/locale/ru';
8
+ import 'dayjs/locale/tr';
9
+ export interface Akidate {
10
+ setLocale(locale: string): void;
11
+ formatIsoDate(date: string, template: string | undefined): string;
12
+ }
13
+ export declare const akidate: Akidate;
14
+ //# sourceMappingURL=akidate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"akidate.d.ts","sourceRoot":"","sources":["../../src/akidate.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AAMzB,MAAM,WAAW,OAAO;IACtB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CACnE;AAED,eAAO,MAAM,OAAO,EAAE,OAmBrB,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.akidate = void 0;
4
+ const dayjs_1 = require("dayjs");
5
+ const localizedFormat_1 = require("dayjs/plugin/localizedFormat");
6
+ // Import the locale files.
7
+ require("dayjs/locale/ar");
8
+ require("dayjs/locale/de");
9
+ require("dayjs/locale/en");
10
+ require("dayjs/locale/es");
11
+ require("dayjs/locale/fr");
12
+ require("dayjs/locale/pt");
13
+ require("dayjs/locale/ru");
14
+ require("dayjs/locale/tr");
15
+ // Default to English.
16
+ dayjs_1.default.locale('en');
17
+ dayjs_1.default.extend(localizedFormat_1.default);
18
+ exports.akidate = {
19
+ /**
20
+ * Set the locale.
21
+ *
22
+ * @param locale Locale string. 2 letters.
23
+ */
24
+ setLocale(locale) {
25
+ dayjs_1.default.locale(locale);
26
+ },
27
+ /**
28
+ * Format an ISO date string.
29
+ *
30
+ * @param date ISO date string.
31
+ * @param template Localized format template strings. Visit https://day.js.org/docs/en/display/format#localized-formats for more information.
32
+ * @returns
33
+ */
34
+ formatIsoDate: (date, template) => {
35
+ return (0, dayjs_1.default)(date).format(template);
36
+ }
37
+ };
@@ -0,0 +1,2 @@
1
+ export * from './akidate';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./akidate"), exports);
@@ -0,0 +1,14 @@
1
+ import 'dayjs/locale/ar';
2
+ import 'dayjs/locale/de';
3
+ import 'dayjs/locale/en';
4
+ import 'dayjs/locale/es';
5
+ import 'dayjs/locale/fr';
6
+ import 'dayjs/locale/pt';
7
+ import 'dayjs/locale/ru';
8
+ import 'dayjs/locale/tr';
9
+ export interface Akidate {
10
+ setLocale(locale: string): void;
11
+ formatIsoDate(date: string, template: string | undefined): string;
12
+ }
13
+ export declare const akidate: Akidate;
14
+ //# sourceMappingURL=akidate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"akidate.d.ts","sourceRoot":"","sources":["../../src/akidate.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AAMzB,MAAM,WAAW,OAAO;IACtB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CACnE;AAED,eAAO,MAAM,OAAO,EAAE,OAmBrB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import dayjs from 'dayjs';
2
+ import localizedFormat from 'dayjs/plugin/localizedFormat';
3
+ // Import the locale files.
4
+ import 'dayjs/locale/ar';
5
+ import 'dayjs/locale/de';
6
+ import 'dayjs/locale/en';
7
+ import 'dayjs/locale/es';
8
+ import 'dayjs/locale/fr';
9
+ import 'dayjs/locale/pt';
10
+ import 'dayjs/locale/ru';
11
+ import 'dayjs/locale/tr';
12
+ // Default to English.
13
+ dayjs.locale('en');
14
+ dayjs.extend(localizedFormat);
15
+ export const akidate = {
16
+ /**
17
+ * Set the locale.
18
+ *
19
+ * @param locale Locale string. 2 letters.
20
+ */
21
+ setLocale(locale) {
22
+ dayjs.locale(locale);
23
+ },
24
+ /**
25
+ * Format an ISO date string.
26
+ *
27
+ * @param date ISO date string.
28
+ * @param template Localized format template strings. Visit https://day.js.org/docs/en/display/format#localized-formats for more information.
29
+ * @returns
30
+ */
31
+ formatIsoDate: (date, template) => {
32
+ return dayjs(date).format(template);
33
+ }
34
+ };
@@ -0,0 +1,2 @@
1
+ export * from './akidate';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './akidate';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/akidate",
3
3
  "description": "A date library for Akinon",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "dist/esm/index.js",