Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] #12

Open
nealeydee opened this issue Jun 25, 2023 · 1 comment
Open

[FEATURE REQUEST] #12

nealeydee opened this issue Jun 25, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@nealeydee
Copy link

Thank you for this code. Working well in my HADashboard.

Could you please point me in the right direction as to how I could modify the code to be able to display the Day Of Week Name (eg Monday, Tuesday) etc?

I managed to add a line to show the day number (0 for Sunday, 1 for Monday etc - unless it was showing 0 for today etc.) but it is beyond my skills to get the widget to display the day name. This is not an issue but a feature request.

Any pointers would be greatly appreciated.
Thanks.

@vche vche added the enhancement New feature or request label Jun 25, 2023
@vche
Copy link
Owner

vche commented Jun 25, 2023

Hi, the code to update would be here.

I currently only support day and month.

The easiest solution to unblock you would be to have something like this to use the day of the week and have a lookup table to get the name:

DAY_NAMES = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
day_num = evt_datetime.getDay();
day_name = DAY_NAMES[day_num]

After which you can replace/add/update as needed the whole date string to display what you'd like.

And I'll try to send a commit in the next couple of weeks to add a configuration option to display the day name to make this available to everyone.

@vche vche self-assigned this Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants