From 985efe3a5c9f177b2e72025f1da25139b7b7fbcd Mon Sep 17 00:00:00 2001 From: Ben Phelps Date: Fri, 16 Sep 2022 11:05:35 +0300 Subject: [PATCH] Updated Information Widgets (markdown) --- Information-Widgets.md | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/Information-Widgets.md b/Information-Widgets.md index ce6274a..9143a49 100644 --- a/Information-Widgets.md +++ b/Information-Widgets.md @@ -116,4 +116,61 @@ or for a custom search: provider: custom url: https://lougle.com/?q= target: _blank +``` + + +## Greeting + +This allows you to display simple text, can be configured like so: + +```yaml +- greeting: + text_size: xl + text: Greeting Text +``` + +Valid text sizes are `4xl`, `3xl`, `2xl`, `xl`, `md`, `sm`, `xs`. + + +## Date & Time + +This allows you to display the date and/or time, can be heavily configured using [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat). + +Formatting is locale aware and will present your date in the regional format you expect, for example, `9/16/22, 3:03 PM` for locale `en` and `16.09.22, 15:03` for `de`. + + +```yaml +- datetime: + text_size: xl + format: + timeStyle: short + hour12: false +``` + +Any options passed to `format` are passed directly to [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat), please reference the MDN documentation for all available options. + +A few examples are, + +```yaml +# 13:37 +format: + timeStyle: short + hour12: false +``` + + +```yaml +# 1:37 PM +format: + timeStyle: short + hour12: true +``` + + +```yaml +# 1/23/22, 1:37 PM +format: + dateStyle: short + timeStyle: short + hour12: true ``` \ No newline at end of file