asv-hlps 1.0.21 → 1.0.24

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.
@@ -42,9 +42,6 @@ const inSteGrp = (grps, user) => {
42
42
  };
43
43
  exports.inSteGrp = inSteGrp;
44
44
  const hasRole = (roles, user) => {
45
- if (!user.ste) {
46
- return null;
47
- }
48
45
  return [...roles].includes(user.role.code.toLowerCase()) ? true : false;
49
46
  };
50
47
  exports.hasRole = hasRole;
@@ -7,8 +7,8 @@ export declare const formatDateYmd: (date: Date | any, separator?: string) => st
7
7
  export declare const formatDateYmFirstDay: (date: Date | any, separator?: string) => string;
8
8
  export declare const formatDateYm: (date: Date | any, separator?: string) => string;
9
9
  export declare const formatDateMd: (date: Date | any, separator?: string) => string;
10
- export declare const convertEnDateToFr: (date: string, separator?: string) => string;
11
- export declare const convertFrDateToEnDate: (date: string, separator?: string) => string;
10
+ export declare const convertEnDateToFr: (date: Date | any, separator?: string) => string;
11
+ export declare const convertFrDateToEnDate: (date: Date | any, separator?: string) => string;
12
12
  export declare const genDateMinutesStep: (step: number, lang?: string) => string[];
13
13
  export declare const percentOf: (nbr: number, percentage: number) => number;
14
14
  export declare const calPercent: (nbr: number, percentage: number) => number;
@@ -49,6 +49,7 @@ const convertEnDateToFr = (date, separator = '-') => {
49
49
  if (!date) {
50
50
  return null;
51
51
  }
52
+ date = new Date(date).toISOString();
52
53
  date = date.trim();
53
54
  const year = date.substring(0, 4);
54
55
  const month = date.substring(5, 7);
@@ -11,9 +11,6 @@ export const inSteGrp = (grps, user) => {
11
11
  return [...grps].includes(user.ste.grp.code.toLowerCase()) ? true : false;
12
12
  };
13
13
  export const hasRole = (roles, user) => {
14
- if (!user.ste) {
15
- return null;
16
- }
17
14
  return [...roles].includes(user.role.code.toLowerCase()) ? true : false;
18
15
  };
19
16
  export const isBillPeriod = (user, period) => {
@@ -7,8 +7,8 @@ export declare const formatDateYmd: (date: Date | any, separator?: string) => st
7
7
  export declare const formatDateYmFirstDay: (date: Date | any, separator?: string) => string;
8
8
  export declare const formatDateYm: (date: Date | any, separator?: string) => string;
9
9
  export declare const formatDateMd: (date: Date | any, separator?: string) => string;
10
- export declare const convertEnDateToFr: (date: string, separator?: string) => string;
11
- export declare const convertFrDateToEnDate: (date: string, separator?: string) => string;
10
+ export declare const convertEnDateToFr: (date: Date | any, separator?: string) => string;
11
+ export declare const convertFrDateToEnDate: (date: Date | any, separator?: string) => string;
12
12
  export declare const genDateMinutesStep: (step: number, lang?: string) => string[];
13
13
  export declare const percentOf: (nbr: number, percentage: number) => number;
14
14
  export declare const calPercent: (nbr: number, percentage: number) => number;
@@ -36,6 +36,7 @@ export const convertEnDateToFr = (date, separator = '-') => {
36
36
  if (!date) {
37
37
  return null;
38
38
  }
39
+ date = new Date(date).toISOString();
39
40
  date = date.trim();
40
41
  const year = date.substring(0, 4);
41
42
  const month = date.substring(5, 7);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.0.21",
3
+ "version": "1.0.24",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",