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

[FEEDBACK] Widgets: DateTime and Weather #402

Closed
shimizurei opened this issue Jan 2, 2022 · 7 comments
Closed

[FEEDBACK] Widgets: DateTime and Weather #402

shimizurei opened this issue Jan 2, 2022 · 7 comments
Labels
🌈 Feedback [ISSUE] Tell us what you think of the project

Comments

@shimizurei
Copy link

For DateTime widget, can we change the name of city?

For example, although I'm using the America/New_York time zone, I do not live in New York. I would like to put the city I live in, but it doesn't have a formal TZ name. Same with America/Chicago, but I would like to be following the time for people living in San Antonio since they have the same time zone. I don't want to change them all; I just want the option (ex. my "Tokyo" tz is fine as-is).

Weather

The daily forecast terms are inconsistently cased. The words visibility, wind, and clouds are not title cased.

weather

Also, thank you so much for the creation of widgets. With this, Dashy has reached basically all my criteria for the perfect dash 😄

@shimizurei shimizurei added the 🌈 Feedback [ISSUE] Tell us what you think of the project label Jan 2, 2022
@Lissy93
Copy link
Owner

Lissy93 commented Jan 2, 2022

Thanks for raising the non-capitalized weather info, I'll get that fixed :)

@Lissy93
Copy link
Owner

Lissy93 commented Jan 2, 2022

So with the time zone place names, it's a bit more complicated. I'm currently doing it like this:

I get the time zone, either from what you've specified under options.timeZone, or using your browsers local time zone, like:

getTimeZone() {
  if (this.options.timeZone) return this.options.timeZone;
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
},

which returns something like: Europe/London

Then, to get the city name, I'm just using the time zone name, like:

getCity(timeZone) {
  return timeZone.split('/')[1].replaceAll('_', ' ');
},

The problem is, that there is no way to natively determine a time zone from an arbitrary city, like San Antonio.

I did look into using a package like kevinroberts/city-timezones, but that would involve either deploying the API and making a network request, or adding 1MB into the bundle size. Both seem a bit over-kill for the simple task.

I guess another option would be to let the user specify a time zone, as well as an arbitrary display name for city.

You can also set hideDate: true, which will hide the top row (both the date and city name). Or if the clock is in it's own section, just setting the section name to your city name.

Anyway, let me know your thoughts, or if you have any other suggestions about a non-complicated implementation

@KierenConnell
Copy link
Contributor

I'd personally like to be able to specify a timezone and then define any other specific value

Something like
timeZone: Europe/London title: *Custom Name Here*

@Lissy93
Copy link
Owner

Lissy93 commented Jan 2, 2022

Cool, okay so that's the option I'll go for :)

@shimizurei
Copy link
Author

Since this is still open, I'd like to add another problem (please tell me if I should create a new issue):

datetime

The Tokyo time doesn't switch to the next day after midnight.

@Lissy93
Copy link
Owner

Lissy93 commented Jan 11, 2022

Sure, thank you, I'll add a fix to the current branch :)
Am away from home at the moment, so might be a few days, sorry about that.

@Lissy93
Copy link
Owner

Lissy93 commented Jan 23, 2022

Forgot to say, but all of the above issues have now been fixed, merged and released in #425 - V 1.9.8 :)

  • Weather labels are correctly capitalized
  • Date will update at midnight on the clock
  • You can set customCityName on the clock

@Lissy93 Lissy93 closed this as completed Jan 23, 2022
asterling8516 pushed a commit to asterling8516/dashy that referenced this issue Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌈 Feedback [ISSUE] Tell us what you think of the project
Projects
None yet
Development

No branches or pull requests

3 participants