[Feature Request] Request to Add "Epoch Date" format to custom-api widget #2962
Replies: 3 comments 1 reply
-
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! ❤️ To address your question about interpreting Epoch & Unix Timestamp numbers as date-time in the Custom-API widget, it's important to note that the Homepage dashboard allows for a high degree of customization, including the ability to create custom widgets that can process various data formats. While the existing Date & Time widget, as described in the documentation, is designed to display the date and time in a human-readable format based on locale settings, it does not directly support Epoch & Unix Timestamp conversion out of the box. However, since Homepage is highly customizable and supports custom JavaScript, you could potentially create a custom widget or modify the existing Custom-API widget to interpret and display the Unix Timestamp as a human-readable date. To achieve this, you would need to write a custom JavaScript function that converts the Unix Timestamp to a Date object and then formats it as desired. The JavaScript Here's a simple example of how you might convert a Unix Timestamp to a human-readable date in JavaScript: function formatUnixTimestamp(unixTimestamp) {
const date = new Date(unixTimestamp * 1000);
return date.toLocaleDateString("en-US"); // You can customize the locale and format options
} You would then use this function within your custom widget's code to process the timestamp data from your service. If you're not familiar with JavaScript or the process of creating custom widgets for Homepage, you may want to refer to the development guidelines and documentation for creating service widgets, which can be found at the provided links in the context. Additionally, if you need further assistance, you could reach out to the community for help or request this feature by creating an issue or discussion on the Homepage GitHub repository. Remember to follow the project's contribution guidelines if you decide to contribute this feature yourself. This comment was generated by Glime. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been automatically closed due to lack of community support. 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
Hi, I really like this dashboard server and I appreviate all the work that has gone into it.
One of my services using the Custom-API widget returns the date as Epoch & Unix Timestamp number, for example: 1720831520
None of the existing Date formats seem interpret these numbers correctly as date-time.
Is this on the radar or even a feasible addition to gethomepage?
Thank you :)
Other
No response
Beta Was this translation helpful? Give feedback.
All reactions