toluschr / BetterDiscord-Animated-Status

Animate your Discord Status with this BetterDiscord Plugin
MIT License
254 stars 488 forks source link

SyntaxError: Unexpected token '{' when using clock and text #83

Open HiddenDeath opened 2 years ago

HiddenDeath commented 2 years ago

image what's wrong??

toluschr commented 2 years ago

Thanks for pointing this out. It seems that the github markdown format was changed and the readme is now rendered incorrectly. Paste this into the emoji field:

eval ['🕛','🕐','🕑','🕒','🕓','🕔','🕕','🕖','🕗','🕘','🕙','🕚'][((new Date()).getHours()%12)];

Paste this into the text field:

eval let fmt=t=>(t<10?'0':'')+t;let d=new Date();`${fmt(d.getHours())}:${fmt(d.getMinutes())}:${fmt(d.getSeconds())}`;
VerySmallfish commented 2 years ago

eval ['🕛','🕐','🕑','🕒','🕓','🕔','🕕','🕖','🕗','🕘','🕙','🕚'][((new Date()).getHours()%12)];


How about 12 hour format?

HiddenDeath commented 2 years ago

about 12 hour idk

HiddenDeath commented 2 years ago

Thanks for pointing this out. It seems that the github markdown format was changed and the readme is now rendered incorrectly. Paste this into the emoji field:

eval ['🕛','🕐','🕑','🕒','🕓','🕔','🕕','🕖','🕗','🕘','🕙','🕚'][((new Date()).getHours()%12)];

Paste this into the text field:

eval let fmt=t=>(t<10?'0':'')+t;let d=new Date();`${fmt(d.getHours())}:${fmt(d.getMinutes())}:${fmt(d.getSeconds())}`;

this worked, thanks <3

stressatoo commented 2 years ago

For 12 hour: eval let fmt=t=>(t<10?'0':'')+t;let d=new Date();`${fmt(d.getHours()%12)}:${fmt(d.getMinutes())} ${d.getHours()>12?'PM':'AM'}`;