Skip to content

πŸ•” library that returns the approximate emoji for the time

License

Notifications You must be signed in to change notification settings

oscarmorrison/moment-emoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

moment-emoji

πŸ•” library that returns the approximate emoji for the time

Use

  • ensure you have moment (hard requirement), loaded first
  • src moment-emoji.js (or copy in file into your js)

on any moment time, just called moment().emoji()

<html>

<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://raw.githack.com/oscarmorrison/moment-emoji/master/moment-emoji.js"></script>


<script>
  var time = moment();
  var emoji = time.emoji();
  console.log(time.format('hh:mm'), emoji);
</script>

</body>
</html>

Demo

http://oscarmorrison.com/moment-emoji/

Screen Shot 2019-07-04 at 11 42 25 pm

Usecase

Why would anyone ever use this? I used it for a quick uebersicht widget that I made.

Screen Shot 2019-07-04 at 11 49 22 pm

Caveat

This was made on MacOS, not sure if it works on other platforms.

About

πŸ•” library that returns the approximate emoji for the time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published