Last active
April 9, 2018 22:38
-
-
Save rockymeza/b1762cd7f7992f68b9b9a1a6c575bf51 to your computer and use it in GitHub Desktop.
Impure implementation of WeekendStatus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
const WeekendStatus = () => { | |
const dayOfWeek = new Date().getDay(); | |
const isWeekend = [0, 6].includes(dayOfWeek); | |
if (isWeekend) { | |
return <p>It's the weekend!</p>; | |
} | |
return <p>It is not the weekend :(</p>; | |
}; | |
export default WeekendStatus; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment