// Optional: get the name of the book day if true export function getBookDayName(date: Date = new Date()): string | null const month = date.getMonth() + 1; const day = date.getDate();
import isBookToday, getBookDayName from './book-days'; // Check today if (isBookToday()) console.log( Yes! Today is $getBookDayName(). ); else console.log("Not a recognized book day."); isbooktoday
const found = BOOK_DAYS.find(bookDay => bookDay.month === month && bookDay.day === day); return found ? found.name : null; // Optional: get the name of the book
// Extend this list as needed const BOOK_DAYS: BookDayRule[] = [ month: 4, day: 23, name: "World Book Day" , // UNESCO month: 4, day: 2, name: "International Children's Book Day" , month: 3, day: 3, name: "World Book Day (UK/Ireland)" , // first Thursday in March often, but simplified month: 9, day: 8, name: "International Literacy Day" , month: 10, day: 16, name: "Dictionary Day" , month: 11, day: 1, name: "National Author's Day" , // US ]; found.name : null