25 Days of omg.lol

Day 4

Today saw a bunch of updates to weblog.lol, though the majority of them—representing hours of work—involved to boring back-end things, like multiple bug fixes and improvements to data storage, caching, post publishing, and feed generation. None of this is particularly exciting in the way that a new feature might be, but it all adds up to some nice boosts in stability, efficiency, and speed. So it makes me happy, for whatever that’s worth.

With that unglamorous preamble out of the way, let’s get to the fun stuff: Time and Drafts!

Time

One of the two feature updates today is about time, and it’s actually three updates in one:

  1. You can now set a preferred timezone.
  2. You can now set a preferred date/time format.
  3. You can use a new {year} tag to reference the current year (hat tip to Jason Burk for the idea!).

The first two are done in your configuration, while the third “just works” anywhere. {year} is useful for things like copyright dates or wherever else you might need to reference the year.

So, how does the timezone and date/time format work? You set them in your configuration. Both use a specific format, but we’ll get to that in a moment. First I should mention that I’m keeping a snapshot of the new default configuration over here in GitHub, so you can refer to it whenever needed. This is useful for when new configuration items are rolled out (which will probably happen a lot), so you’ll know what to pull into your own configuration file.

Timezone

Setting the timezone is as easy as adding a line like this to your configuration:

Timezone: Australia/Perth

We’re using the timezone values from the IANA database, which is a fairly decent standardized representation of global timezones. To find yours, just pull up this Wikipedia article and grab yours from under the “TZ database name” heading.

Date/Time format

As with the timezone setting above, this is another entry in your configuration file. Here’s an example:

Date format: F j, Y g:i A

This format would produce something like this December 3, 2022 10:48 PM.

“But how do I know what weird letters to use?” Well, until I get this documented somewhere, here’s a cheatsheet:

Type Value Explanation
Year Y The four digit year, like 2022
Year y The two digit year, like 22
Month F The month fully spelled out, like September
Month M A three character month abbreviation, like Sep
Month m The month number, with a leading zero, like 09
Month n The month number, without a leading zero, like 9
Day l The day fully spelled out, like Saturday
Day D A three character day abbreviation, like Sat
Day d The day number, with a leading zero, like 07
Day j The day number, without a leading zero, like 7
Hour g 12-hour format of an hour without leading zeros (1-12)
Hour G 24-hour format of an hour without leading zeros (0-23)
Hour h 12-hour format of an hour with leading zeros (01-12)
Hour H 24-hour format of an hour with leading zeros (00-23)
Minute i Minutes (with leading zeros)
Seconds s Seconds (with leading zeros)
Beats B Swatch Internet time (000-999)
Meridiem A Uppercase meridiem indicator (AM or PM)
Meridiem a Lowercase meridiem indicator (am or pm)

This should be pretty much everything you need to format your date/time string exactly how you want it.

Now, there’s one more cool thing that went live today:

Drafts

Up to now, every post in your weblog became a live, published post as soon as you clicked save. This wasn’t the result of any kind of ultra-strict publishing mindset; it was the brutal reality of not having any way of managing drafts.

Starting now, you can mark a post as a draft by simply adding this post metadata (at the top of your weblog post):

Status: Draft

That’s it! Instant draft. If you add this to a brand-new weblog post and save it, it’ll remain hidden everywhere. If you add it to a previously published post, that post will become hidden everywhere. When your draft is no longer a draft, simply remove the metadata, save, and it’ll be live.

So, yeah, that’s it for day four. Hopefully the new stuff isn’t as buggy as the previous three days of new stuff was. But if you do run into any bugs, just let me know.

More to come tomorrow, as usual! 👋

Adam