Replies: 3 comments
-
Thanks for posting a discussion about homepage here on GitHub. Homepage now uses a fancy new AI tool thanks to our friends at Glime, so the answer below is the AI bot's attempt to answer your question. If you feel it's sufficient you can mark the answer and close this post, otherwise feel free to leave it open of course! Thanks for using Homepage! ❤️ Based on the information provided, it seems you are trying to format Unix timestamps for sunrise and sunset times using the Custom API widget in Homepage. The To handle Unix timestamps, you will need to convert them to a Date object before formatting. Since the Custom API widget does not natively support Unix timestamp conversion, your approach to use However, it seems there might be an issue with the way you are trying to apply the custom JavaScript. The Here's how you can adjust your mappings:
- field:
forecast:
daily:
0:
sunset
label: Sunset
format: text # Use text to handle formatting in JS
additionalField:
id: sunset-time # This is a custom field for targeting with JS And in your If the widget does support additional fields, ensure that your JavaScript code is executed after the widget has been rendered and the DOM is fully loaded. If the widget is loaded asynchronously or there is a delay in rendering, you may need to use a different event or method to ensure your code runs at the right time. If you continue to face issues, you may want to reach out to the Homepage community or check the GitHub issues/discussions for similar cases or further assistance. Remember to check the browser console for any errors that might indicate problems with your custom JavaScript code or other issues with the widget rendering. This comment was generated by Glime. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been automatically closed due to inactivity. See our contributing guidelines for more details. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns. See our contributing guidelines for more details. |
Beta Was this translation helpful? Give feedback.
-
Description
Hey, so, as per the title, I am using the custom API service widget to pull weather data from an API. The sunrise and sunset times are in unixtime though, and using
format: date
does not know how to handle it, just displaying Jan 20th 1970, for example.I've looked through a bit of documentation and tried to use custom.js, but I'm clearly missing a few pieces somewhere. See below for config details of what I've tried.
homepage version
v0.8.13
Installation method
Docker
Configuration
Container Logs
No response
Browser Logs
No response
Troubleshooting
Nothing other than modifying services.yaml and custom.js
Did a search in other discussions but didn't see anything that I found helpful.
Beta Was this translation helpful? Give feedback.
All reactions