toluschr / BetterDiscord-Animated-Status

Animate your Discord Status with this BetterDiscord Plugin
MIT License
255 stars 489 forks source link

Small Request.... #36

Closed Joolian1 closed 3 years ago

Joolian1 commented 3 years ago

Can i request something please... For this code "eval let fmt=t=>(t<10?'0':'')+t;let d=new Date();${fmt(d.getHours())}:${fmt(d.getMinutes())}:${fmt(d.getSeconds())};", "eval ['🕛','🕐','🕑','🕒','🕓','🕔','🕕','🕖','🕗','🕘','🕙','🕚'][((new Date()).getHours()%12)];"

Can i ask you for this code but with 12Hours, not 24Hours + with PM and AM.... Please because in my region doesn't use this one....

also we appreciate your work <3

toluschr commented 3 years ago

Javascript is pretty limited in terms of formatting date. You have to do this mess

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

The code is minified, I just put in the changes.