mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
refactor: Rewrite time module to use module config (#483)
- Config option renamed: `12hr` → `use_12hr`
This commit is contained in:
committed by
Matan Kushner
parent
bc9e44f45c
commit
27e8c8f3eb
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user