Skip to content

Instantly share code, notes, and snippets.

View Steellgold's full-sized avatar

Gaëtan H Steellgold

View GitHub Profile
import { dayJS } from "./day-js";
export const completeDateIfNecessary = (dayInput: string): string => {
const dateRegex = /^\d{2}\/\d{2}\/\d{4}$/;
if (dateRegex.test(dayInput)) {
console.log("Format correct :", dayInput);
return dayInput;
}