Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
automated commit 04/03/2019 18:03:00
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmerza committed Mar 4, 2019
1 parent 011e425 commit f0f7052
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
16 changes: 11 additions & 5 deletions calendar-card.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion custom_updater.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"calendar-card": {
"updated_at": "2019-03-04",
"version": "3.2.0",
"version": "3.3.0",
"remote_location": "https://raw.githubusercontent.com/ljmerza/calendar-card/master/calendar-card.js",
"visit_repo": "https://github.com/ljmerza/calendar-card",
"changelog": "https://github.com/ljmerza/calendar-card/releases/latest"
Expand Down
17 changes: 8 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ class CalendarCard extends LitElement {
// generate urls for calendars and get each calendar data
const urls = entities.map(entity => `calendars/${entity}?start=${start}Z&end=${end}Z`);
const allResults = await this.getAllUrls(urls);
console.log({ allResults });


// convert each calendar object to a UI event
const newEvents = [].concat(...allResults).map(event => new CalendarEvent(event));

Expand Down Expand Up @@ -242,7 +241,7 @@ class CalendarCard extends LitElement {
const eventsTemplate = eventDay.events.map((event, index) => html`
<tr class='day-wrapper ${eventDay.events.length === index + 1 ? 'day-wrapper-last' : ''}'>
<td class="date">
${this.getDateHtml(index,momentDay)}
${this.getDateHtml(index, momentDay)}
</td>
<td class="overview" @click=${() => this.getLinkHtml(event)}>
<div class="title">${event.title}</div>
Expand Down Expand Up @@ -280,8 +279,8 @@ class CalendarCard extends LitElement {
* create card header
* @return {TemplateResult}
*/
createHeader(){
if(this.config.title === false) return html``;
createHeader() {
if (this.config.title === false) return html``;

return html`
<div class='header'>
Expand Down Expand Up @@ -346,10 +345,10 @@ class CalendarCard extends LitElement {

/**
* generates HTML for showing date an event is taking place
* @param {index,momentDay}
* @param {number} index index of current day event
* @param {Moment} momentDay
*/
getDateHtml(index,momentDay) {

getDateHtml(index, momentDay) {
const top = index === 0 ? momentDay.format(this.config.dateTopFormat) : '';
const bottom = index === 0 ? momentDay.format(this.config.dateBottomFormat) : '';

Expand All @@ -368,7 +367,7 @@ class CalendarCard extends LitElement {
* @param {CalendarEvent} event
*/
getTimeHtml(event) {
if(this.config.hideTime === true) return html``;
if (this.config.hideTime === true) return html``;

if (event.isFullDayEvent) return html`<div class="time">All day</div>`;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "calendar-card",
"version": "3.2.0",
"version": "3.3.0",
"description": "A calendar card for Home Assistant Lovelace UI",
"keywords": [
"home-assistant",
Expand Down

0 comments on commit f0f7052

Please sign in to comment.