refactor: Rewrite time module to use module config (#483)

- Config option renamed: `12hr` → `use_12hr`
This commit is contained in:
Thomas Lee
2019-10-06 00:07:00 +09:00
committed by Matan Kushner
parent bc9e44f45c
commit 27e8c8f3eb
9 changed files with 60 additions and 33 deletions
+3 -3
View File
@@ -874,13 +874,13 @@ To enable it, set `disabled` to `false` in your configuration file.
| Variable | Default | Description |
| ---------- | ------------- | ------------------------------------------------------------------------------------------------------------------- |
| `12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `bold yellow` | The style for the module time |
| `disabled` | `true` | Disables the `time` module. |
If `12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`.
Manually setting `format` will override the `12hr` setting.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`.
Manually setting `format` will override the `use_12hr` setting.
### Example
+2 -2
View File
@@ -812,12 +812,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Default | Description |
| ---------- | ------------- | ------------------------------------------------------------------------------------------------------------------- |
| `12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `bold yellow` | The style for the module time |
| `disabled` | `true` | Disables the `time` module. |
If `12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `12hr` setting.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### Example
+2 -2
View File
@@ -812,12 +812,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Default | Description |
| ---------- | ------------- | ------------------------------------------------------------------------------------------------------------------- |
| `12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `bold yellow` | The style for the module time |
| `disabled` | `true` | Disables the `time` module. |
If `12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `12hr` setting.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### Example
+2 -2
View File
@@ -813,12 +813,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Default | Description |
| ---------- | ------------- | ------------------------------------------------------------------------------------------------------------------- |
| `12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `bold yellow` | The style for the module time |
| `disabled` | `true` | Disables the `time` module. |
If `12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `12hr` setting.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### Example
+2 -2
View File
@@ -812,12 +812,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Default | Description |
| ---------- | ------------- | ------------------------------------------------------------------------------------------------------------------- |
| `12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `bold yellow` | The style for the module time |
| `disabled` | `true` | Disables the `time` module. |
If `12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `12hr` setting.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### Example
+2 -2
View File
@@ -812,12 +812,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Default | Description |
| ---------- | ------------- | ------------------------------------------------------------------------------------------------------------------- |
| `12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `bold yellow` | The style for the module time |
| `disabled` | `true` | Disables the `time` module. |
If `12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `12hr` setting.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### Example