Skip to content

Instantly share code, notes, and snippets.

@rockymeza
Last active April 9, 2018 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rockymeza/b1762cd7f7992f68b9b9a1a6c575bf51 to your computer and use it in GitHub Desktop.
Save rockymeza/b1762cd7f7992f68b9b9a1a6c575bf51 to your computer and use it in GitHub Desktop.
Impure implementation of WeekendStatus
import * as React from 'react';
const WeekendStatus = () => {
const dayOfWeek = new Date().getDay();
const isWeekend = [0, 6].includes(dayOfWeek);
if (isWeekend) {
return <p>It&apos;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