のすたろう、const isTodayBirthday = (
day: number | undefined,
month: number | undefined
): boolean => {
if (!day || !month) return false;
const now = new Date();
const thisYear = now.getFullYear();
const birthday = new Date(thisYear, month - 1, day); // ここで 2/29 は勝手に 3/1 になる
return (
birthday.getMonth() === now.getMonth() &&
birthday.getDate() === now.getDate()
);
};ってどう?