idaho / hassio-trash-card

TrashCard - indicates what type of trash will be picked up next based on your calendar entries 🗑️
Apache License 2.0
113 stars 14 forks source link

"day_style: counter" calculation wrong #224

Closed mistergyle closed 6 months ago

mistergyle commented 6 months ago

Requirements

Current Behavior

the calculation of th counter in "day_Style" seems wrong. also "next_days" seems not to work correctly!?

today: 23.02.2024 next event "Restmüll": 26.02.2024

TRY 1 settings: day_style: counter next_days: 3

result: event doesn't show up?

TRY 2 settings: day_style: counter next_days: 4

result: event shows up - label: "in 2 Tagen" > "in 2 days"

Expected Behavior

settings: day_style: counter next_days: 3

result: event shows up - label: "in 3 Tagen" because 23.02 + 3 days = 26.02

Steps To Reproduce

No response

Context

YAML state

drop_todayevents_from: '10:00:00'
next_days: 4
settings:
  others:
    color: purple
    icon: mdi:trash-can
  organic:
    label: Biomüll
    icon: mdi:flower
    color: green
    pattern: Bio
  paper:
    label: Altpapier
    icon: mdi:newspaper-variant-multiple
    color: blue
    pattern: Altpapier
  recycle:
    label: Gelber Sack
    icon: mdi:recycle-variant
    color: yellow
    pattern: Gelbe Säcke
  waste:
    label: Restmüll
    icon: mdi:trash-can-outline
    color: grey
    pattern: Rest
day_style: counter
type: custom:trash-card
entity: calendar.muellabfuhr
filter_events: true
fill_container: true
full_size: false
use_summary: false

Environment

- Browser:
- HA Version:
- TrashCard:

Anything else?

No response

idaho commented 6 months ago

@mistergyle Please checkout the latest beta version of the trash card. This should be fixed in there. If you need help on how to install the latest beta version, have a look at https://hacs.xyz/docs/faq/beta/ . Please give some feedback if its then working for you or not.

mistergyle commented 6 months ago

@idaho test with 2.0.0-beta.5:

today: 27.02.2024 next event "Bioabfall": 29.02.2024 (in 2 days)

settings:

day_style: counter
next_days: 2

result: event doesn't show up?

settings:

day_style: counter
next_days: 3

result: event shows up - label: "in 2 Tagen" (correct)

idaho commented 6 months ago

@mistergyle stupid bug. Fix is released in the latest beta version

mistergyle commented 6 months ago

Thanks. Working now