Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DigiGov-OSS
AuditRecordDB
Commits
95e01519
Commit
95e01519
authored
Feb 16, 2022
by
Panagiotis Skarvelis
Browse files
fix seq type gen
parent
2c8b5158
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/engines/file/protocol.ts
View file @
95e01519
...
...
@@ -9,15 +9,16 @@ import { SEQTYPES } from '../../interfaces/index.js';
*/
const
protocol
=
(
protocol_path
:
string
,
seqtype
:
SEQTYPES
)
=>
{
let
protocol_split
=
"
aion
"
;
let
protocol_date
=
new
Date
().
toISOString
().
split
(
'
T
'
)[
0
];
switch
(
seqtype
){
case
"
daily
"
:
protocol_split
=
new
Date
().
toISOString
().
split
(
'
T
'
)[
0
]
;
protocol_split
=
protocol_date
;
break
;
case
"
monthly
"
:
protocol_split
=
new
Date
().
toISOString
()
.
split
(
'
T
'
)[
0
].
split
(
'
-
'
)[
1
];
protocol_split
=
protocol_date
.
split
(
'
-
'
)[
0
]
+
"
-
"
+
protocol_date
.
split
(
'
-
'
)[
1
];
break
;
case
"
yearly
"
:
protocol_split
=
new
Date
().
toISOString
().
split
(
'
T
'
)[
0
]
.
split
(
'
-
'
)[
0
];
protocol_split
=
protocol_date
.
split
(
'
-
'
)[
0
];
break
;
case
"
innumerable
"
:
protocol_split
=
"
aion
"
;
...
...
@@ -25,7 +26,7 @@ const protocol = (protocol_path: string,seqtype:SEQTYPES) => {
}
const
path
=
`
${
protocol_path
}
/
${
protocol_split
}
.protocol.sequence`
;
const
protocol_sequence
=
sequence
(
path
,
path
);
//Protocol starts from 1 each day.
let
pn
=
protocol_sequence
+
"
/
"
+
protocol_
split
;
let
pn
=
protocol_sequence
+
"
/
"
+
protocol_
date
;
return
pn
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment