Skip to content

Commit

Permalink
Ensure calender follows time format locale (#9966)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacegaier committed Sep 6, 2021
1 parent 605172a commit 0187c4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/panels/calendar/ha-full-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from "lit";
import { property, state } from "lit/decorators";
import memoize from "memoize-one";
import { useAmPm } from "../../common/datetime/use_am_pm";
import { fireEvent } from "../../common/dom/fire_event";
import "../../components/ha-button-toggle-group";
import "../../components/ha-icon-button";
Expand Down Expand Up @@ -214,6 +215,11 @@ export class HAFullCalendar extends LitElement {
...defaultFullCalendarConfig,
locale: this.hass.language,
initialView: this.initialView,
eventTimeFormat: {
hour: useAmPm(this.hass.locale) ? "numeric" : "2-digit",
minute: useAmPm(this.hass.locale) ? "numeric" : "2-digit",
hour12: useAmPm(this.hass.locale),
},
};

config.dateClick = (info) => this._handleDateClick(info);
Expand Down

0 comments on commit 0187c4f

Please sign in to comment.