bearblog
bearblog copied to clipboard
[Misc] `<input type="datetime-local">` might be preferable?
For some reason, in Safari on macOS at least, the <input type="date">
tag doesn't let me actually remove the date to post now, but if I use an <input type="datetime-local">
I can. However, Mozilla recommend that you add pattern="\d{4}-\d{2}-\d{2} \d{2}:\d{2}"
, and I'd probably also add placeholder="YYYY-MM-DD HH:MM"
for fallback… because, bizarrely enough Firefox itself doesn't support datetime-local
. This is a whole can of worms, so I can appreciate if this one just stays in the backlog until I inevitably get off my ass and actually make some pull requests myself.
At the same time, however – and I didn't want to include this in the title, because it's kinda an exploit: allowing time setting sort of allows you to make a post infinitely new, gaming the Discovery feed. Obviously I like that I can retroactively add posts to my blog! But at the same time, I just made a post, realised it came up as "30 minutes ago" (because that's when I saved it, so I had to hit the Delete key and hope it blanked out the date), and it became instantly recent. If I was nefarious, I could take a popular post and simply change the date to make it look more recent, gaming the algorithm to keep it on top forever. Or something like that, anyhow.
I'm not sure if this is something people will ever do, though. My head tells me disallowing changing the date after a post gets a single toast would work best, but my heart tells me this is a total non-issue as nobody's ever tried to game the Discovery feed, so I'm unsure on what to make of this.
Yep. I struggled with this issue for a while and relegated it to "hopefully no-one exploits it", which has been fine so far. If in the future this becomes an issue I'll spend some time on it.
I'm hoping Safari (which I also use as my default browser) gets better support for DateTime input as well as it's quite a mission setting up the cross browser support necessary to handle this gracefully.
Closing stale issue. Date and time are now handled in the header options with the ability to add timezone (if you really want, but probably better to stick to UTC).