Skip to content

Commit

Permalink
refactor!: remove timeColor and timeSize options
Browse files Browse the repository at this point in the history
  • Loading branch information
marksie1988 committed Sep 24, 2023
1 parent 960a2d7 commit 824bbe4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export default {
showNoEventDays: false,


timeColor: 'var(--primary-color)', // Time text color (center bottom)
timeSize: 90, //Time text size
showHours: true, //shows the bottom line (time, duration of event)
showRelativeTime: true,

Expand Down
13 changes: 4 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,24 +408,19 @@ export class AtomicCalendarRevive extends LitElement {

// Show the hours
const hoursHTML = this._config.showHours
? html`<div
class="hours"
style="--time-color: ${this._config.timeColor}; --time-size: ${this._config.timeSize}%"
>
${getHoursHTML(this._config, event)}
? html`<div class="hours">
${getHoursHTML(this._config, event)}
</div>`
: html``;

// Show the relative time
if (this._config.showRelativeTime || this._config.showTimeRemaining) {
const now = dayjs()
var timeUntilRemaining = html`<div
class="relative-time time-remaining"
style="--time-color: ${this._config.timeColor}; --time-size: ${this._config.timeSize}%">
const timeUntilRemaining = html`<div class="relative-time time-remaining">
${this._config.showRelativeTime && (event.startDateTime.isAfter(now, 'minutes')) ? `(${event.startDateTime.fromNow()})` : this._config.showTimeRemaining && (event.startDateTime.isBefore(now, 'minutes') && event.endDateTime.isAfter(now, 'minutes')) ? `${dayjs.duration(event.endDateTime.diff(now)).humanize()}` : ''}
</div>`

} else { var timeUntilRemaining = html`` }
} else { const timeUntilRemaining = html`` }


const lastEventStyle = !this._config.compactMode && i == arr.length - 1 ? 'padding-bottom: 8px;' : '';
Expand Down
2 changes: 0 additions & 2 deletions src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ export interface atomicCardConfig extends LovelaceCardConfig {
showNoEventDays?: boolean;
noEventText?: string;
noEventsForNextDaysText?: string;
timeColor?: string;
timeSize?: number;
showHours?: boolean;
eventTitleColor?: string;
locationIconColor?: string;
Expand Down

2 comments on commit 824bbe4

@czendler
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those options will get back in the future?
Calendars looks much nicer with different dates and times colors

@marksie1988
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No as the same can be done with card_mod.

Please sign in to comment.