25 lines
788 B
TypeScript
25 lines
788 B
TypeScript
export const checkSpecialVersion = (paragraph: string): string => {
|
|
try {
|
|
const patterns = [
|
|
/\(CAT[1-9]K.*Version 16\.9\.[2-9]/,
|
|
/\(CAT[1-9]K.*Version 1[7-9]\.[0-9]\.[0-9]/,
|
|
/\(CAT[1-9]K.*Version [2-9][0-9]\.[0-9]\.[0-9]/,
|
|
];
|
|
for (const regex of patterns) {
|
|
const match = paragraph.match(regex);
|
|
if (match) return match[0];
|
|
}
|
|
return "";
|
|
} catch {
|
|
return "";
|
|
}
|
|
};
|
|
|
|
export const checkDateWiki = (logString:string) => {
|
|
const now = new Date();
|
|
const currentDate = `ngay ${String(now.getDate()).padStart(2, "0")}/${String(now.getMonth() + 1).padStart(2, "0")}/${now.getFullYear()}`;
|
|
|
|
const lines = logString.split("<br/>").slice(0,3);
|
|
const lineDate = lines?.length > 1 ? lines[1] : ""
|
|
return lineDate === currentDate
|
|
} |