Birthday reminder card for Lovelace

Hi again Andrea,

Thanks again for your kind words. :slight_smile:

According to the page I linked, CalDAV was supported as of August 2018, so you may not have to look any further?

Erlend

1 Like

Oh I must have missed that!
Thanks for looking at that for me!

Much appreciated!!!

Andrea

Hello! Nice work :grinning:. How add background color in this card. Nice by rounded corners :wink:.
Thanks

Ryszard

I love the card but why is the date: {name:“Robin”, day:1, month:1, year:2006},apper as he will be 13 year next time… it would be 14?..

[macce76] You are right. Thanks for pointing that out! :slight_smile: Age fixed in version 1.1

Thanks Ryszard!

This is probably best done through creating a theme for HA. It seems like rounded corners will be possible to control through a theme in next version of HA (0.88.0):

If you want to change just this one card, you can try this:

1 Like

Thank you!

What’s the number, in parenthesis, after the number of days?

image

Never mind. It’s the actual birthday, in the format of Day.Month I presume.
Odd way to present that, lol

Yep, you are right. The odd European way… :wink:

this can come in handy for when my next days off are (holidays)

Hi, thanks for this great card!

I appear to have an issue though where the next event in my list says it is happening in 6 days time, however the next event is actually on SAT 02 MAR 2019 which is not 6 days from now.

Wondered if the logic in the code takes into account the fact that February only has 28 days (unless it is a leap year)?

Cheers,
James

James: This is a strange error. I did get the same error when I tested the date you struggled with, but unfortunately I am not able to find a solution. To calculate the number of days, I ask Javascript for a timestamp (the number of milliseconds that have passed since January 1, 1970) for today and the same for the birthday. Then I calculate the difference by subtracting the timestamp for today from the birthday, and convert the difference from milliseconds to days. This seem to work fine for most dates, but for some reason did not work for 02 MAR when still in February. The function I use to calculate the timestamp is a native javascript function, and I really can’t figure out what went wrong. If anyone with better command of javascript can give me a hint, I would be grateful. :slight_smile:

Well thanks for having a look. Actually as soon as it got to 01 MAR it correctly said it was in “1 day” so it must be something to do with February having less days.

James (jimbob1001) discovered a bug in birthday-card, where the displayed number of days until an upcoming birthday in March was calculated wrong when the current date was still in February. With the help of a friend, I managed to find the error in the script. Hopefully it is now corrected in the latest version (v1.2), but we won’t know for sure until next February. :slight_smile: Kudos to James for discovering the bug!

1 Like

I just discovered a new bug in v1.2. It displayed the moths wrong in the list (the month was displayed as one month earlier than it should be). It is now corrected. My apologies!

Ha, that’s a long wait to test! I should set an event to remind me to check!!! Oh and next year is a leap year so February will have 29 days instead of 28!! :grimacing:

@Erlend I installed this today and it does not show any names and birthdays that I have set up. I even deleted all the ones you had and your example ones still show up, and if I edit those to a different month or day it does not change.

also the only way I could get anything to show up was to set number of days to 365

I am running hassbian 0.89.1, Not hassio All my other lovelace stuff works

EDIT: I Got it, I didn’t see you had to change the version number after editing

I was about to ask if you have updated the version number after editing, but am glad to see that you have figured it out on your own. Unfortunately this is a common thing for all custom cards, but normally you don’t have to edit the .js file that often with other cards.

@Erlend
You can change the direction
That it would be RTL?

Nevermind :blush: I solved it
Hi @Erlend It looks great from here - but I cant make it work!? It’s my first custom card, do I need to put anything in configuration.yaml?