Commit 95e01519 authored by Panagiotis Skarvelis's avatar Panagiotis Skarvelis
Browse files

fix seq type gen

parent 2c8b5158
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment