What’s the number, in parenthesis, after the number of days?
Never mind. It’s the actual birthday, in the format of Day.Month I presume.
Odd way to present that, lol
What’s the number, in parenthesis, after the number of days?
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…
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.
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. Kudos to James for discovering the bug!
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!!
@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.
Nevermind 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?
I got a strange error “Uncaught SyntaxError: Octal literals are not allowed in strict mode.” any idea how to fix?
Just getting started with Hassio but I got this card tested. Now how can one implement an alert based off of birthdays in the list.
Hi! I have been thinking along the same lines, but am not sure how to go about it. I’m not even sure whether it is possible to accomplish with a javascript lovelace plugin? I might have to look into making a sensor for it instead.
Yeah you would have to add some type of sensor with maybe attributes…
SO I hvae just installed this. And I have tried to change out the default information provided. And I have read above that you have to change the version number. I am assuming that this is in the lovelace config portion where you put the resource yes? And what version number do you start with and if one edit is made to your original file what version number would that go to? I know you would probably think that people would automatically now that increments of it… but every “plugin” is different. Thanks in advance!
Hi Tiffany! You are correct that the version number comes after the “?v=” of the URL where you define the resources. It doesn’t matter much what number you start on, as long as you increase the number every time you do any changes to the list. You may start at 1 and go up to whatever it takes, or you may start at 0.001 and increase from there. This is the same for all custom cards. The only difference is that you normally won’t need to change the file that often with other cards, where you probably only update the file every time the developer of the card release a new version. I hope you get the card to work, and that you find it useful.
I actually did get it to work… must have been my cache … Works great though thank you!