dev-resources.site
for different kinds of informations.
Chinese Zodiac Time for Emacs
In the spirit of Chinese New Year, I hacked up a small extension for Emacs to render the current time of day using emoji and Chinese characters:
Various configurations for your mode line.
Itโs just a silly project that Iโll consider a success if it puts a smile on someoneโs face, but it is loosely based on a system used to measure time in the Ming dynasty which divided the day into 12 equal periods (ๆ1), named after the 12 earthly branches (ๅฐๆฏ).
Because the animals of the Chinese zodiac map 1-to-1 with the earthly branches, it is equally possible to indicate the time with the zodiac animals!
Chart of correspondence between the earthly branches, zodiac animals, and times of day from Wikipedia. Apologies on this being in Spanish.
Given that a modern user probably wants to know which of our 24 hours theyโre in, rather than which two hour period (ๆ), I decided to differentiate the two halves as either ๅฐ (small) or ๅคง (large).
Hence, in the image above showing the time as ใๅคง๐ฒ ๅๅไบๅใ, the current time is 8:42am, by our modern reckoning (7:42am would be the little dragon!).
I wonโt go into a ton of detail here because I explain it in some detail on the projectโs GitHub page.
The most amusing part of the project was, perhaps, deciding exactly which emoji to use! In the end, I implemented two sets of emoji you can choose from:
Set | Emoji |
---|---|
'cute |
๐ญ๐ฎ๐ฏ๐ฐ๐ฒ๐๐ด๐๐ต๐๐ถ๐ท |
'emoji |
๐๐๐ ๐๐๐๐๐๐๐๐๐ |
Rather disappointing that we donโt quite have a complete set of animal faces. At least not in Appleโs emoji.
If youโre wondering why I chose the COW (๐) emoji in the second set rather than the OX (๐), itโs because it looked too similar to the neighboring TIGER (๐ ), making it easy to confuse the time.
If you donโt like my choices, the library also makes it extremely easy to bring your own set of emoji, so you can make your own decisions between:
- RAT (๐), MOUSE (๐), and MOUSE FACE (๐ญ)
- SHEEP (๐), GOAT (๐), and RAM (๐)
- HORSE (๐) and HORSE FACE (๐ด)
- CHICKEN (๐) and ROOSTER (๐)
- Or maybe even pretend FROG (๐ธ) is a snake face
- Or spice up your horse with UNICORN (๐ฆ)
Clearly the skyโs the limit.
For Chinese learners or traditionalists, it can also display the time with:
- Traditional characters: ใๅคง้พ ๅๅไบๅใ2
- Simplified characters: ใๅคง้พ ๅๅไบๅใ
- Or earthly branches: ใ่พฐๆญฃ ๅๅไบๅใ
(n.b. the earthly branches are displayed using the proper, traditional system of ๅ and ๆญฃ suffixes, not my invented prefixes for animals.)
Itโs a lot of fun telling time with cute animals, and might even help you learn a few things if youโre a beginner in Chinese, so check it out on GitHub!
้พๅนดๅฟซๆจ๏ผๆญๅ็ผ่ฒก๏ผ ๐๐งง
Students of the Chinese language may find it interesting to know that these two hour periods are the reason we call (single) hours ๅฐ ๆ in modern Chinese (I know I did!). โฉ๏ธ
Itโs not 100% clear to me if these characters will render the same regardless of locale, so I apologize if they do not appear as I have describedโIโm still trying to get my head around CJK unification in Unicode. โฉ๏ธ
Featured ones: