Anniversaries icon indicating copy to clipboard operation
Anniversaries copied to clipboard

Using 'Day' instead of 'Days' for remaining days 0 and 1

Open satyambaba opened this issue 3 years ago • 1 comments

First of all, kudos to you for this awesome integration. The only issue that I see that it shows unit of measurement "Days" instead of "Day" even when 'daysRemaining' is 1 or 0. I know this is not a big thing, however please consider this as a feature request. For now, as a workaround, I modified the "sensor.py" file as below :

    if daysRemaining <= 1:
        self._icon = self._icon_today
        self._unit_of_measurement = "Day"

However, whenever I'll update this integration from HACS it might replace that code. It would be great if you can incorporate this with in your code. Nevertheless, thanks a lot for your efforts.

satyambaba avatar Jan 16 '22 15:01 satyambaba

This was actually removed with the release of version 3.0.0, when the option to configure the name of the unit of measurement was introduced. The problem is that the unit of measurement is not translatable, and so days was replaced with a single configurable option to allow people to have the unit displayed in their own language. It doesn't seem to be worth adding an extra config option for a singular for unit of measurement, when it would only be applied one day in each year

pinkywafer avatar Jan 17 '22 15:01 pinkywafer

That’s a shame

DrSpaldo avatar Feb 16 '23 22:02 DrSpaldo

Previous comment deleted... Wrong thread

pinkywafer avatar Feb 16 '23 22:02 pinkywafer