Skip to content

Multiple lines

Nick Korotysh edited this page Feb 3, 2024 · 3 revisions

It is possible to configure the clock to display time/date in multiple lines. Custom date/time format string must be used to achieve this. The date/time string must contain "new line" character escape sequence (\n), each \n is considered as "line break". No \n should be at the end of format string.

For example, format string hh\nmm will produce 2 rows: the top one will contain hours, and the bottom one - minutes.

Additionally, as each line may have different length, it is possible to control some layout aspects if multiple lines format is used. Layout configuration string should be provided for that. The following control characters are supported in this string:

  • 0 - default options: align baseline, no stretching
  • 1 - enable stretching
  • < - align left or top (depending on orientation)
  • > - align right or bottom (depending on orientation)
  • x - align center (only in one direction)

Characters describe configuration line by line, number of characters in this configuration string should match number of lines, if it is less than number of lines, default options are used for the rest of lines. Any characters not listed here are considered as 0.

For example, for the hh\nmm time format used as example above, you can specify xx as layout configuration string to make sure that both rows are centered (actually only one row will be centered, depending on which one is wider), or 01 to make sure that minutes' row width always matches hours' row width.

01 configuration string can be extremely useful if you want long date string under the time string.

Clone this wiki locally