Skip to content

Instantly share code, notes, and snippets.

@wires
Created April 10, 2017 14:30
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 wires/e579caa7acfd101bce14027435f0c1da to your computer and use it in GitHub Desktop.
Save wires/e579caa7acfd101bce14027435f0c1da to your computer and use it in GitHub Desktop.
npm.im/node-weekji

Weekday Emoji

https://twitter.com/changelog/status/823562124920291328

module.exports = function (weekday) {
  switch (weekday % 7) {
    case 0: return 'πŸ˜–'
    case 1: return 'πŸ™„'
    case 2: return '😟'
    case 3: return '😐'
    case 4: return 'πŸ˜†'
    case 5: return 'πŸ˜‚'
    case 6: return '😴'
  }
}

Usage

npm install node-weekji

Then

const wji = require('node-weekji')
console.log(wji(new Date().getDay()))
// https://twitter.com/changelog/status/823562124920291328
module.exports = function (weekday) {
switch (weekday % 7) {
case 0: return 'πŸ˜–'
case 1: return 'πŸ™„'
case 2: return '😟'
case 3: return '😐'
case 4: return 'πŸ˜†'
case 5: return 'πŸ˜‚'
case 6: return '😴'
}
}
{
"name": "node-weekji",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment