hl-core 0.0.10-beta.38 → 0.0.10-beta.39
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/composables/index.ts +26 -0
- package/package.json +1 -1
- package/types/enum.ts +1 -0
package/composables/index.ts
CHANGED
|
@@ -89,6 +89,29 @@ export const reformatDate = (date: string) => {
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
+
export const reformatDateWithHours = (date: string) => {
|
|
93
|
+
if (date) {
|
|
94
|
+
const data = new Date(date);
|
|
95
|
+
let day: string | number = data.getDate();
|
|
96
|
+
let month: string | number = data.getMonth() + 1;
|
|
97
|
+
let hour: string | number = data.getHours();
|
|
98
|
+
let minute: string | number = data.getMinutes();
|
|
99
|
+
if (month < 10) {
|
|
100
|
+
month = '0' + month;
|
|
101
|
+
}
|
|
102
|
+
if (day < 10) {
|
|
103
|
+
day = '0' + day;
|
|
104
|
+
}
|
|
105
|
+
if (minute < 10) {
|
|
106
|
+
minute = '0' + minute;
|
|
107
|
+
}
|
|
108
|
+
const year = data.getFullYear();
|
|
109
|
+
return `${day}.${month}.${year} - ${hour}:${minute}`;
|
|
110
|
+
} else {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
92
115
|
export const reformatIin = (iin: string) => {
|
|
93
116
|
if (!!iin) {
|
|
94
117
|
const matched = iin.match(/.{1,3}/g);
|
|
@@ -818,6 +841,9 @@ export class RoleController {
|
|
|
818
841
|
isUrsp = () => {
|
|
819
842
|
return this.isRole(constants.roles.URSP);
|
|
820
843
|
};
|
|
844
|
+
isArchivist = () => {
|
|
845
|
+
return this.isRole(constants.roles.Archivist);
|
|
846
|
+
};
|
|
821
847
|
hasAccess = () => {
|
|
822
848
|
const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn();
|
|
823
849
|
return {
|
package/package.json
CHANGED