Skip to content

Commit

Permalink
Mobile view calendar improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
silamon committed Jan 1, 2024
1 parent 6cc9a99 commit 5c53785
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
12 changes: 11 additions & 1 deletion src/panels/calendar/ha-full-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class HAFullCalendar extends LitElement {
</ha-icon-button-next>
</div>
</div>
<div class="controls">
<div class="controls buttons">
<mwc-button
outlined
class="today"
Expand Down Expand Up @@ -479,6 +479,16 @@ export class HAFullCalendar extends LitElement {
width: 100%;
}
.buttons {
display: flex;
flex-wrap: wrap;
}
.buttons > * {
margin-bottom: 5px;
box-sizing: border-box;
}
.today {
margin-right: 20px;
margin-inline-end: 20px;
Expand Down
2 changes: 1 addition & 1 deletion src/panels/calendar/ha-panel-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class PanelCalendar extends LitElement {
.events=${this._events}
.calendars=${this._calendars}
.narrow=${this.narrow}
.initialView=${this.narrow ? "listWeek" : "dayGridMonth"}
initialView="dayGridMonth"
.hass=${this.hass}
.error=${this._error}
@view-changed=${this._handleViewChanged}
Expand Down
10 changes: 5 additions & 5 deletions src/panels/lovelace/cards/hui-calendar-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {

@state() private _narrow = false;

@state() private _veryNarrow = false;

@state() private _error?: string = undefined;

private _startDate?: Date;
Expand Down Expand Up @@ -121,9 +119,11 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {
return nothing;
}

const views: FullCalendarView[] = this._veryNarrow
? ["listWeek"]
: ["dayGridMonth", "dayGridDay", "listWeek"];
const views: FullCalendarView[] = [
"dayGridMonth",
"dayGridDay",
"listWeek",
];

return html`
<ha-card>
Expand Down

0 comments on commit 5c53785

Please sign in to comment.