mattrossman / forecaswatch2

Open source revival of the beloved ForecasWatch Pebble watchface
https://apps.rebble.io/en_US/application/5dcdca6ac393f50cf6dbc264
GNU General Public License v3.0
36 stars 13 forks source link

Calendar date number repeats upon month changing #44

Closed BrentTechDesigns closed 3 years ago

BrentTechDesigns commented 4 years ago

I noticed this morning (October 25 2020) that the calendar dates displayed: 18 19 20 21 22 23 24 [25] 26 27 28 29 30 31 1 1 2 3 4 5 6

This appears due to the calendar month rotating from a month ending with 31 days on a Saturday. The big was easily remedied by going to another screen and coming back to the watch face. The calendar properly set to: 18 19 20 21 22 23 24 [25] 26 27 28 29 30 31 1 2 3 4 5 6 7

arromdee commented 3 years ago

This issue is not caused by 31 day months. It is caused by daylight savings time.

The program finds the next day by adding and subtracting multiples of 24 hours. If the time is between midnight and 1 AM, and the clocks are being set back, 24 hours after 12:01 AM Sunday is 11:01 PM still on Sunday, Since the day starts on midnight and the calendar refreshes at the start of the day, this means that the calendar goes bad at midnight and stays that way until it passes 1 AM and it's refreshed (by going to another screen and changing to the watch face.)

I have a patch for this as well as for making Sundays, Saturdays, and/or US Federal holidays red based on a setting. I have no idea what to do with it--should I mail it to the maintainer? Attach it here?

mattrossman commented 3 years ago

@arromdee good catch! You can submit your patch as a pull request against the develop branch of this repository. I'll review it and merge it in once everything looks good.

arromdee commented 3 years ago

I submitted a patch which 1) fixes this bug and 2) adds the requested ability to make Sundays red (along with Saturdays and US Federal holidays).

mattrossman commented 3 years ago

Thanks for the patch, it's included in v1.15.0