unfinished birthday greeting feature

This commit is contained in:
David Ralph
2020-11-30 16:47:22 +00:00
parent 7bfa7ed0a8
commit 7862c43752
4 changed files with 52 additions and 9 deletions

View File

@@ -47,6 +47,10 @@ export default class Greeting extends React.PureComponent {
if (custom === 'false') name = name.replace(',', '');
// Birthday
const birth = new Date(localStorage.getItem('birthday'));
if (birth.getDate() === now.getDate() && birth.getMonth() === now.getMonth() && birth.getFullYear() !== 1001) message = 'Happy Birthday';
// Set the state to the greeting string
this.setState({
greeting: `${message}${name}`