@finema/core 1.3.17 → 1.3.18

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/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, installModule, addPlugin, addComponen
2
2
  import { merge } from 'lodash-es';
3
3
 
4
4
  const name = "@finema/core";
5
- const version = "1.3.17";
5
+ const version = "1.3.18";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -1,10 +1,10 @@
1
- import * as dayjs from "dayjs";
2
- import * as relativeTime from "dayjs/plugin/relativeTime";
3
- import * as utc from "dayjs/plugin/utc";
4
- import * as duration from "dayjs/plugin/duration";
5
- dayjs.extend(relativeTime.default);
6
- dayjs.extend(utc.default);
7
- dayjs.extend(duration.default);
1
+ import dayjs from "dayjs";
2
+ import relativeTime from "dayjs/plugin/relativeTime";
3
+ import utc from "dayjs/plugin/utc";
4
+ import duration from "dayjs/plugin/duration";
5
+ dayjs.extend(relativeTime);
6
+ dayjs.extend(utc);
7
+ dayjs.extend(duration);
8
8
  const isTimeError = (time) => time === "Invalid Date";
9
9
  const timeWrapper = (time, defaultTime) => isTimeError(time) ? defaultTime : time;
10
10
  const dateFormat = "YYYY-MM-DD";
@@ -16,7 +16,7 @@ export class TimeHelper {
16
16
  return time;
17
17
  }
18
18
  try {
19
- const newTime = dayjs.default(time).subtract(7, "hour").format(dateTimeFormat);
19
+ const newTime = dayjs(time).subtract(7, "hour").format(dateTimeFormat);
20
20
  return timeWrapper(newTime, time);
21
21
  } catch (e) {
22
22
  return time.toString();
@@ -27,57 +27,57 @@ export class TimeHelper {
27
27
  return time;
28
28
  }
29
29
  try {
30
- const newTime = dayjs.default(time).add(7, "hour").format(dateTimeFormat);
30
+ const newTime = dayjs(time).add(7, "hour").format(dateTimeFormat);
31
31
  return timeWrapper(newTime, time);
32
32
  } catch (e) {
33
33
  return time;
34
34
  }
35
35
  };
36
36
  static getCurrentDate = () => {
37
- const newTime = dayjs.default().format(dateFormat);
37
+ const newTime = dayjs().format(dateFormat);
38
38
  return timeWrapper(newTime, "");
39
39
  };
40
40
  static getDateFormTime = (time) => {
41
41
  if (!time) {
42
42
  return time;
43
43
  }
44
- const newTime = dayjs.default(time).format(dateFormat);
44
+ const newTime = dayjs(time).format(dateFormat);
45
45
  return timeWrapper(newTime, time);
46
46
  };
47
47
  static getDateFormTimeWithLocal = (time) => {
48
48
  if (!time) {
49
49
  return time;
50
50
  }
51
- const newTime = dayjs.default(TimeHelper.toLocal(time)).format(dateFormat);
51
+ const newTime = dayjs(TimeHelper.toLocal(time)).format(dateFormat);
52
52
  return timeWrapper(newTime, time);
53
53
  };
54
54
  static getISODateTimeFormTime = (time) => {
55
55
  if (!time) {
56
56
  return time;
57
57
  }
58
- const testTime = dayjs.default(time).format(dateTimeFormat);
58
+ const testTime = dayjs(time).format(dateTimeFormat);
59
59
  if (isTimeError(testTime)) {
60
60
  return time;
61
61
  }
62
- const newTime = dayjs.default(time).toISOString();
62
+ const newTime = dayjs(time).toISOString();
63
63
  return isTimeError(newTime) || !newTime ? time : newTime;
64
64
  };
65
65
  static getDateTimeFormTime = (time) => {
66
66
  if (!time) {
67
67
  return time;
68
68
  }
69
- const newTime = dayjs.default(time).format(dateTimeFormat);
69
+ const newTime = dayjs(time).format(dateTimeFormat);
70
70
  return timeWrapper(newTime, time);
71
71
  };
72
72
  static getTimeFormTime = (time) => {
73
73
  if (!time) {
74
74
  return time;
75
75
  }
76
- const newTime = dayjs.default(time).format(timeFormat);
76
+ const newTime = dayjs(time).format(timeFormat);
77
77
  return timeWrapper(newTime, time);
78
78
  };
79
79
  static getCurrentDateTime = () => {
80
- const newTime = dayjs.default().format(dateTimeFormat);
80
+ const newTime = dayjs().format(dateTimeFormat);
81
81
  return timeWrapper(newTime, "");
82
82
  };
83
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Development Team",