Skip to content

Commit

Permalink
Merge pull request #1130 from totaldebug/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
marksie1988 authored Sep 5, 2023
2 parents cb01fe5 + b3abdd5 commit 6d90e6e
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 64 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@material/mwc-select": "^0.27.0",
"@material/mwc-switch": "^0.27.0",
"@material/mwc-textfield": "^0.27.0",
"@mdi/js": "^7.2.96",
"@webcomponents/webcomponentsjs": "^2.8.0",
"custom-card-helpers": "^1.9.0",
"dayjs": "^1.11.9",
Expand Down
1 change: 0 additions & 1 deletion src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default {
eventTitleSize: 100,

locationIconColor: 'rgb(--primary-text-color)', //Location link settings (right side)
locationLinkColor: 'var(--primary-text-color)',
locationTextSize: 90,

// finished events settings
Expand Down
8 changes: 8 additions & 0 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ export class AtomicCalendarReviveEditor extends ScopedRegistryHost(LitElement) i
max: 99999999999,
default: defaultConfig.maxDaysToShow
},
{
type: 'number',
name: 'startDaysAhead',
label: localize('main.fields.startDaysAhead'),
min: 0,
max: 999,
default: defaultConfig.startDaysAhead
},
{
type: 'number',
name: 'refreshInterval',
Expand Down
13 changes: 7 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { HomeAssistant, LovelaceCardEditor, getLovelace } from 'custom-card-help
import { formatTime } from './helpers/format-time';
import { groupEventsByDay, getEventMode, getCalendarMode } from './lib/event.func';
import { styles } from './style';
import { mdiChevronLeft, mdiChevronRight } from "@mdi/js";

// DayJS for managing date information
import dayjs from 'dayjs';
Expand Down Expand Up @@ -498,23 +499,23 @@ export class AtomicCalendarRevive extends LitElement {
<ha-icon-button
class="prev"
style="--mdc-icon-color: ${this._config.calDateColor}"
icon="mdi:chevron-left"
.path=${mdiChevronLeft}
.label=${this.hass.localize('ui.common.previous')}
@click="${() => this.handleMonthChange(-1)}"
title=${this.hass.localize('ui.common.previous')}
>
<ha-icon icon="mdi:chevron-left"></ha-icon>
</ha-icon-button>
<span class="date" style="text-decoration: none; color: ${this._config.calDateColor};">
${this.selectedMonth.format('MMMM')} ${this.selectedMonth.format('YYYY')}
</span>
<ha-icon-button
class="next"
style="--mdc-icon-color: ${this._config.calDateColor}"
icon="mdi:chevron-right"
.path=${mdiChevronRight}
.label=${this.hass.localize('ui.common.next')}
@click="${() => this.handleMonthChange(1)}"
title=${this.hass.localize('ui.common.next')}
>
<ha-icon icon="mdi:chevron-right"></ha-icon>
</ha-icon-button>
</div>`;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/common.html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import dayjs, { Dayjs } from "dayjs";
import { html } from "lit";
import { atomicCardConfig } from "../types/config";
import EventClass from "./event.class";
import { mdiCalendar } from "@mdi/js";

export function showCalendarLink(config, selectedMonth) {
if (!config.disableCalLink) {
return html`<div class="calIconSelector">
<ha-icon-button
icon="mdi:calendar"
.path=${mdiCalendar}
style="--mdc-icon-color: ${config.calDateColor}"
onClick="window.open('https://calendar.google.com/calendar/r/month/${selectedMonth.format('YYYY')}/${selectedMonth.format('MM')}/1'), '${config.linkTarget}'"
>
<ha-icon icon="mdi:calendar"></ha-icon>
</ha-icon-button>
</div>`;
}
Expand Down
30 changes: 16 additions & 14 deletions src/localize/languages/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@
"firstDayOfWeek": "Første dag i ugen 0-6",
"cardHeight": "Højde på kort",
"hideDuplicates": "Skjul dubletter",
"showMultiDay": "Opdelt flerdages begivenheder",
"showMultiDayEventParts": "Vis flere dages begivenhedsdele",
"eventTitle": "Indstil tom begivenhedstitel",
"compactMode": "Aktiver kompakt tilstand",
"hoursOnSameLine": "Vis timer på begivenhedslinjen",
"titleLength": "Max titellængde (0 for ubegrænset)",
"descLength": "Max beskrivelseslængde (0 for ubegrænset)"
"showMultiDay": "Opdelt flerdages begivenheder",
"showMultiDayEventParts": "Vis flere dages begivenhedsdele",
"eventTitle": "Indstil tom begivenhedstitel",
"compactMode": "Aktiver kompakt tilstand",
"hoursOnSameLine": "Vis timer på begivenhedslinjen",
"titleLength": "Max titellængde (0 for ubegrænset)",
"descLength": "Max beskrivelseslængde (0 for ubegrænset)",
"showAllDayEvents": "Vis heldagsbegivenheder",
"offsetHeaderDate": "Forskudt overskriftsdato",
"startDaysAhead": "Begivenheder starter `x` dage fra i dag"
}
},
"event": {
Expand All @@ -77,12 +80,12 @@
"showEventIcon": "Vis aftale ikon",
"showHiddenText": "Vis skjulte aftaler tekst?",
"hiddenEventText": "Tekst til skjulte aftaler:",
"showCalendarName": "Vis kalendernavn",
"showWeekNumber": "Vis ugenumre",
"showEventDate": "Vis dato for arrangementer",
"showDatePerEvent": "Vis dato ud for hver begivenhed",
"showTimeRemaining": "Vis resterende tid",
"showAllDayHours": "Vis Heldagsbegivenhedstekst"
"showCalendarName": "Vis kalendernavn",
"showWeekNumber": "Vis ugenumre",
"showEventDate": "Vis dato for arrangementer",
"showDatePerEvent": "Vis dato ud for hver begivenhed",
"showTimeRemaining": "Vis resterende tid",
"showAllDayHours": "Vis Heldagsbegivenhedstekst"
}
},
"calendar": {
Expand All @@ -104,7 +107,6 @@
"secondary": "Global indstillinger for farver"
},
"fields": {
"locationLinkColor": "Placerings link farve:",
"dimFinishedEvents": "Nedtone overståede aftaler?"
}
}
Expand Down
28 changes: 15 additions & 13 deletions src/localize/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@
"firstDayOfWeek": "Erster Wochentag 0-6",
"cardHeight": "Kartenhöhe",
"hideDuplicates": "Duplikate ausblenden",
"showMultiDay": "Split meerdaagse evenementen",
"showMultiDayEventParts": "Toon meerdaagse evenementonderdelen",
"eventTitle": "Lege evenementtitel instellen",
"compactMode": "Schakel de compacte modus in",
"hoursOnSameLine": "Toon uren op de gebeurtenisregel",
"titleLength": "Maximale titellengte (0 voor onbeperkt)",
"descLength": "Maximale beschrijvingslengte (0 voor onbeperkt)"
"showMultiDay": "Split meerdaagse evenementen",
"showMultiDayEventParts": "Toon meerdaagse evenementonderdelen",
"eventTitle": "Lege evenementtitel instellen",
"compactMode": "Schakel de compacte modus in",
"hoursOnSameLine": "Toon uren op de gebeurtenisregel",
"titleLength": "Maximale titellengte (0 voor onbeperkt)",
"descLength": "Maximale beschrijvingslengte (0 voor onbeperkt)",
"showAllDayEvents": "Toon evenementen die de hele dag duren",
"offsetHeaderDate": "Datum koptekst verschuiven",
"startDaysAhead": "Evenementen die `x` dagen vanaf vandaag beginnen"
}
},
"event": {
Expand All @@ -76,11 +79,11 @@
"showEventIcon": "Ereignis-Symbol anzeigen?",
"showHiddenText": "Versteckten Ereignistext anzeigen?",
"hiddenEventText": "Text für versteckte Ereignisse",
"showCalendarName": "Toon agendanaam",
"showWeekNumber": "Toon weeknummers",
"showEventDate": "Toon datum voor evenementen",
"showDatePerEvent": "Toon datum naast elk evenement",
"showTimeRemaining": "Laat de resterende tijd zien",
"showCalendarName": "Toon agendanaam",
"showWeekNumber": "Toon weeknummers",
"showEventDate": "Toon datum voor evenementen",
"showDatePerEvent": "Toon datum naast elk evenement",
"showTimeRemaining": "Laat de resterende tijd zien",
"showAllDayHours": "Toon de tekst van de hele dag-gebeurtenis"
}
},
Expand All @@ -103,7 +106,6 @@
"secondary": "Globale Farbeinstellungen"
},
"fields": {
"locationLinkColor": "Farbe für Links zu Ortsangaben:",
"dimFinishedEvents": "Erledigte Einträge blasser anzeigen?"
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"titleLength": "Max title length (0 for unlimited)",
"descLength": "Max description length (0 for unlimited)",
"showAllDayEvents": "Show all day events",
"offsetHeaderDate": "Offset header date"
"offsetHeaderDate": "Offset header date",
"startDaysAhead": "Events starting `x` days from today"
}
},
"event": {
Expand Down Expand Up @@ -106,7 +107,6 @@
"secondary": "Global Color Settings"
},
"fields": {
"locationLinkColor": "Location Link Color:",
"dimFinishedEvents": "Dim finished events?"
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/localize/languages/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
"compactMode": "Kompaktrežiimi lubamine",
"hoursOnSameLine": "Näidake sündmuse reale tundi",
"titleLength": "Pealkirja maksimaalne pikkus (0 piiramatu jaoks)",
"descLength": "Kirjelduse maksimaalne pikkus (0 piiramatu puhul)"
"descLength": "Kirjelduse maksimaalne pikkus (0 piiramatu puhul)",
"showAllDayEvents": "Näita kogu päeva sündmusi",
"offsetHeaderDate": "Nihke päise kuupäev",
"startDaysAhead": "Sündmused alates tänasest `x` päeva pärast"
}
},
"event": {
Expand Down Expand Up @@ -102,7 +105,6 @@
"secondary": "Üldised värvuse sätted"
},
"fields": {
"locationLinkColor": "Asukohaviite värv:",
"dimFinishedEvents": "Kas tumendada lõppenud sündmused?"
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/localize/languages/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"common": {
"previous": "Edellinen",
"next": "Seuraava",
"week": "Viikko"
"week": "Viikko"
}
},
"errors": {
Expand Down Expand Up @@ -54,7 +54,10 @@
"compactMode": "Ota kompakti tila käyttöön",
"hoursOnSameLine": "Näytä tunnit tapahtumarivillä",
"titleLength": "Otsikon enimmäispituus (0 rajattomasti)",
"descLength": "Kuvauksen enimmäispituus (0 rajattomasti)"
"descLength": "Kuvauksen enimmäispituus (0 rajattomasti)",
"showAllDayEvents": "Näytä koko päivän tapahtumat",
"offsetHeaderDate": "Offset otsikon päivämäärä",
"startDaysAhead": "Tapahtumat alkavat `x` päivän kuluttua tästä päivästä"
}
},
"event": {
Expand Down Expand Up @@ -104,7 +107,6 @@
"secondary": "Yleiset väriasetukset"
},
"fields": {
"locationLinkColor": "Sijaintilinkin väri:",
"dimFinishedEvents": "Himmennä päättyneet tapahtumat?"
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/localize/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
"compactMode": "Activer le mode compact",
"hoursOnSameLine": "Afficher les heures sur la ligne de l'événement",
"titleLength": "Longueur maximale du titre (0 pour illimité)",
"descLength": "Longueur maximale de la description (0 pour illimité)"
"descLength": "Longueur maximale de la description (0 pour illimité)",
"showAllDayEvents": "Afficher les événements de la journée",
"offsetHeaderDate": "Date d'en-tête décalée",
"startDaysAhead": "Événements commençant `x` jours à partir d’aujourd’hui"
}
},
"event": {
Expand Down Expand Up @@ -104,7 +107,6 @@
"secondary": "Paramètres globaux de couleur"
},
"fields": {
"locationLinkColor": "Couleur du lien d'un lieu:",
"dimFinishedEvents": "Diminuer la visibilité des événements terminés?"
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/localize/languages/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
"compactMode": "Aktiver kompakt modus",
"hoursOnSameLine": "Vis timer på arrangementslinjen",
"titleLength": "Maks tittellengde (0 for ubegrenset)",
"descLength": "Maks beskrivelseslengde (0 for ubegrenset)"
"descLength": "Maks beskrivelseslengde (0 for ubegrenset)",
"showAllDayEvents": "Vis heldagsbegivenheter",
"offsetHeaderDate": "Offset overskriftsdato",
"startDaysAhead": "Arrangementer som starter `x` dager fra i dag"
}
},
"event": {
Expand Down Expand Up @@ -104,7 +107,6 @@
"secondary": "Valg som virker globalt"
},
"fields": {
"locationLinkColor": "Farge for posjonslenke:",
"dimFinishedEvents": "Tone ned avsluttede hendelser?"
}
}
Expand Down
30 changes: 16 additions & 14 deletions src/localize/languages/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@
"firstDayOfWeek": "Prvi dan v tednu 0-6",
"cardHeight": "Višina kartice",
"hideDuplicates": "skrij dvojnike",
"showMultiDay": "Razdeljeni večdnevni dogodki",
"showMultiDayEventParts": "Prikaži dele večdnevnega dogodka",
"eventTitle": "Nastavite prazen naslov dogodka",
"compactMode": "Omogoči kompaktni način",
"hoursOnSameLine": "Prikaži ure na vrstici dogodkov",
"titleLength": "Največja dolžina naslova (0 za neomejeno)",
"descLength": "Največja dolžina opisa (0 za neomejeno)"
"showMultiDay": "Razdeljeni večdnevni dogodki",
"showMultiDayEventParts": "Prikaži dele večdnevnega dogodka",
"eventTitle": "Nastavite prazen naslov dogodka",
"compactMode": "Omogoči kompaktni način",
"hoursOnSameLine": "Prikaži ure na vrstici dogodkov",
"titleLength": "Največja dolžina naslova (0 za neomejeno)",
"descLength": "Največja dolžina opisa (0 za neomejeno)",
"showAllDayEvents": "Pokaži celodnevne dogodke",
"offsetHeaderDate": "Datum zamika glave",
"startDaysAhead": "Dogodki, ki se začnejo `x` dni od danes"
}
},
"event": {
Expand All @@ -77,12 +80,12 @@
"showEventIcon": "Pokaži ikono dogodka",
"showHiddenText": "Pokaži skrito besedilo dogodka?",
"hiddenEventText": "Besedilo za skrite dogodke:",
"showCalendarName": "Pokaži ime koledarja",
"showWeekNumber": "Prikaži številke tednov",
"showEventDate": "Pokaži datum za dogodke",
"showDatePerEvent": "Prikažite datum poleg vsakega dogodka",
"showTimeRemaining": "Pokaži preostali čas",
"showAllDayHours": "Prikaži besedilo celodnevnega dogodka"
"showCalendarName": "Pokaži ime koledarja",
"showWeekNumber": "Prikaži številke tednov",
"showEventDate": "Pokaži datum za dogodke",
"showDatePerEvent": "Prikažite datum poleg vsakega dogodka",
"showTimeRemaining": "Pokaži preostali čas",
"showAllDayHours": "Prikaži besedilo celodnevnega dogodka"
}
},
"calendar": {
Expand All @@ -104,7 +107,6 @@
"secondary": "Glavne barvne nastavitve"
},
"fields": {
"locationLinkColor": "Barva povezave do lokacije:",
"dimFinishedEvents": "Zatemniti končane dogodke?"
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/localize/languages/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
"compactMode": "Aktivera kompakt läge",
"hoursOnSameLine": "Visa öppettider på evenemangsraden",
"titleLength": "Max titellängd (0 för obegränsat)",
"descLength": "Max beskrivningslängd (0 för obegränsat)"
"descLength": "Max beskrivningslängd (0 för obegränsat)",
"showAllDayEvents": "Visa heldagshändelser",
"offsetHeaderDate": "Offset rubrikdatum",
"startDaysAhead": "Händelser som börjar `x` dagar från och med idag"
}
},
"event": {
Expand Down Expand Up @@ -102,7 +105,6 @@
"secondary": "Globala färginställningar"
},
"fields": {
"locationLinkColor": "Färg för platslänk:",
"dimFinishedEvents": "Dimma slutförda händelser?"
}
}
Expand Down
1 change: 0 additions & 1 deletion src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export interface atomicCardConfig extends LovelaceCardConfig {
eventTitleColor?: string;
eventTitleSize?: number;
locationIconColor?: string;
locationLinkColor?: string;
locationTextSize?: number;

// finished events settings
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,11 @@
"@material/theme" "14.0.0-canary.53b3cad2f.0"
tslib "^2.1.0"

"@mdi/js@^7.2.96":
version "7.2.96"
resolved "https://registry.yarnpkg.com/@mdi/js/-/js-7.2.96.tgz#a2a20be740a75e65c8b8b9e12a2b699c06a9208f"
integrity sha512-paR9M9ZT7rKbh2boksNUynuSZMHhqRYnEZOm/KrZTjQ4/FzyhjLHuvw/8XYzP+E7fS4+/Ms/82EN1pl/OFsiIA==

"@nicolo-ribaudo/[email protected]":
version "2.1.8-no-fsevents.3"
resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b"
Expand Down

0 comments on commit 6d90e6e

Please sign in to comment.