diff --git a/src/App.tsx b/src/App.tsx index e366641..5ebe6c0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -34,7 +34,7 @@ function App() { const sortPersons = (birthdays: Birthday[]) => { birthdays = birthdays.reduce((result: Birthday[], item: Birthday) => { const birthday = `${(new Date()).getFullYear()}-${pad(item.month)}-${pad(item.day)}` - item.birthday = (new Date()).toISOString().split('T')[0] < birthday ? birthday : `${(new Date()).getFullYear() + 1}-${pad(item.month)}-${pad(item.day)}` + item.birthday = (new Date()).toISOString().split('T')[0] <= birthday ? birthday : `${(new Date()).getFullYear() + 1}-${pad(item.month)}-${pad(item.day)}` result.push(item) return result }, []) diff --git a/src/components/BirthdayList.tsx b/src/components/BirthdayList.tsx index be84b85..a99e2b5 100644 --- a/src/components/BirthdayList.tsx +++ b/src/components/BirthdayList.tsx @@ -19,7 +19,7 @@ const BirthdayList: FC = ({birthdays, selectedPerson, selectP ) } content.push(
  • + className={`${selectedPerson?.id === birthday.id ? 'bg-blue-400' : ((new Date).getDate() === birthday.day && ((new Date).getMonth() + 1) === birthday.month ? 'bg-yellow-500 py-1' : '')} hover:bg-blue-300 flex gap-2 flex-wrap`}>
    selectPerson(birthday)}> {birthday.name}