mirror of https://github.com/Lissy93/dashy.git
✨ Option to hide seconds in Clock (#644)
This commit is contained in:
parent
bcb1b70447
commit
4287092ea2
|
@ -97,6 +97,7 @@ A simple, live-updating time and date widget with time-zone support. All fields
|
||||||
**`format`** | `string` | _Optional_ | A country code for displaying the date and time in local format.<br>Specified as `[ISO-3166]-[ISO-639]`, for example: `en-AU`. See [here](https://www.fincher.org/Utilities/CountryLanguageList.shtml) for a full list of locales. Defaults to the browser / device's region
|
**`format`** | `string` | _Optional_ | A country code for displaying the date and time in local format.<br>Specified as `[ISO-3166]-[ISO-639]`, for example: `en-AU`. See [here](https://www.fincher.org/Utilities/CountryLanguageList.shtml) for a full list of locales. Defaults to the browser / device's region
|
||||||
**`customCityName`** | `string` | _Optional_ | By default the city from the time-zone is shown, but setting this value will override that text
|
**`customCityName`** | `string` | _Optional_ | By default the city from the time-zone is shown, but setting this value will override that text
|
||||||
**`hideDate`** | `boolean` | _Optional_ | If set to `true`, the date and city will not be shown. Defaults to `false`
|
**`hideDate`** | `boolean` | _Optional_ | If set to `true`, the date and city will not be shown. Defaults to `false`
|
||||||
|
**`hideSeconds`** | `boolean` | _Optional_ | If set to `true`, seconds will not be shown. Defaults to `false`
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,9 @@ export default {
|
||||||
if (this.options.customCityName) return this.options.customCityName;
|
if (this.options.customCityName) return this.options.customCityName;
|
||||||
return this.timeZone.split('/')[1].replaceAll('_', ' ');
|
return this.timeZone.split('/')[1].replaceAll('_', ' ');
|
||||||
},
|
},
|
||||||
|
showSeconds() {
|
||||||
|
return !this.options.hideSeconds;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
update() {
|
update() {
|
||||||
|
@ -48,7 +51,7 @@ export default {
|
||||||
timeZone: this.timeZone,
|
timeZone: this.timeZone,
|
||||||
hour: 'numeric',
|
hour: 'numeric',
|
||||||
minute: 'numeric',
|
minute: 'numeric',
|
||||||
second: 'numeric',
|
...(this.showSeconds && { second: 'numeric' }),
|
||||||
}).format();
|
}).format();
|
||||||
},
|
},
|
||||||
/* Get and format the date */
|
/* Get and format the date */
|
||||||
|
|
Loading…
Reference in New Issue