Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion packages/core/src/evaluator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,30 @@ function findIssues(cv: string, archetype: RoleArchetype) {
}
}

const DATE_FORMAT_PATTERNS = [
{ type: "YYYY-MM", regex: /\b\d{4}-\d{2}\b/ },
{ type: "MM-YYYY", regex: /\b\d{2}-\d{4}\b/ },
{ type: "YYYY-YYYY", regex: /\b\d{4}\s*-\s*\d{4}\b/ },
{ type: "Mon YYYY", regex: /\b(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+\d{4}\b/i }
];

const formats = new Set<string>();

for (const { type, regex } of DATE_FORMAT_PATTERNS) {
if (regex.test(cv)) {
formats.add(type);
}
}

if (formats.size > 1) {
issues.push({
element: "Inconsistent date formats",
why: `Multiple formats detected: ${[...formats].join(", ")}`,
fix: "Use a consistent format throughout. Recommended: Mon YYYY (e.g., Jan 2022).",
severity: "minor",
});
}

return issues;
}

Expand Down Expand Up @@ -225,4 +249,4 @@ function extractKeywords(jd: string): string[] {
.filter((w) => w.length > 2 && !stopWords.has(w));

return [...new Set(words)];
}
}