pablopunk / time

The simplest but configurable online clock
https://time.pablopunk.com
92 stars 8 forks source link

feature: Add '?pad' option #23

Closed buschtoens closed 3 years ago

buschtoens commented 3 years ago

Personally, I dislike the formatting inconsitency very much and would prefer 00:47:00 over 0:47:00.

image
vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pablopunk/time/5MxJ8T1EzXjgDtMpo5DVytfGv2e6
✅ Preview: https://time-git-fork-buschtoens-pad-all-pablopunk.vercel.app

pablopunk commented 3 years ago

But I don't like it that way 😓 . I prefer the no padding option. Let's do this: I'll push the ?pad option to create the behaviour you like. Also, I'll move the ?format=12 formatting into whatTimeIsIt cause your changes were messing with that option enabled (my bad, putting it on render()...)

pablopunk commented 3 years ago

....vercel.app/?pad

buschtoens commented 3 years ago

What about supporting fully-fledged date format strings (instead)?

e.g. via date-fns, luxon, or even the new stage 3 @js-temporal/polyfill? DateTimeFormat#formatToParts would also be highly interesting.

pablopunk commented 3 years ago

@buschtoens that's an interesting idea, I thought of doing a basic formatting option. But for now, I didn't find many use cases for it, so let's merge this one and see if someone is interested in that in the future 🎉

buschtoens commented 3 years ago

Cool! Thanks :)