Skip to content

Commit

Permalink
Fixed bug in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Wassenhoven committed Jun 23, 2021
1 parent 55c4b8b commit 8562df7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lovelace-digital-clock",
"version": "1.1.0",
"version": "1.1.1",
"description": "Home Assistant Digital Clock",
"keywords": [
"home-assistant",
Expand Down
5 changes: 2 additions & 3 deletions src/DigitalClock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class DigitalClock extends LitElement {
private _intervalId?: number;

public setConfig(config: IDigitalClockConfig): void {
this._config = config;
this._config = { ...config };
if (this._config.timeFormat)
this._config.firstLineFormat = this._config.timeFormat;
if (this._config.dateFormat)
Expand Down Expand Up @@ -86,8 +86,7 @@ export class DigitalClock extends LitElement {

private _updateDateTime(): void {
let dateTime = DateTime.now();
if (this._config?.locale)
dateTime = dateTime.setLocale(this._config.locale);
dateTime = dateTime.setLocale(this._config?.locale ?? dateTime.resolvedLocaleOpts().locale);

let firstLine: string;
let secondLine: string;
Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const CARD_VERSION = '1.1.0';
export const CARD_VERSION = '1.1.1';

0 comments on commit 8562df7

Please sign in to comment.