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

Calendar: All items scheduled for one day late #1718

Closed
Kugelfang666 opened this issue Jul 8, 2019 · 14 comments
Closed

Calendar: All items scheduled for one day late #1718

Kugelfang666 opened this issue Jul 8, 2019 · 14 comments

Comments

@Kugelfang666
Copy link

Kugelfang666 commented Jul 8, 2019

lease only submit re
When submitting a new issue, please supply the following information:

Platform: Raspberry Pi 2/3

MagicMirror Version: latest version pulled from git 2019-07-07

Description:

The calendar plugin shows items on wrong date. I'm connected to two iCloud calendars. An Item which is scheduled for tomorrow appears to be due for the day after tomorrow. All other plugins like the clock are showing correct date + time

Additional Notes: this problem occurred once I updated the installation. Previously I was running a version dating back to April. Problem occurred without touching the config.js

EDIT:
I did some more digging and changed the timeFormat to "date headers" interestingly the plugin shows actually a wrong date. For example a item which is in the ical file for the 9th appears to be due on the 10th.

		{
			module: 'calendar',
			header: 'Kalender',
			position: 'top_left',
			config: {
				fade: false,
				showEnd: false,
				fullDayEventDateFormat:'DD MMM',
				maximumNumberOfDays: 31,
				timeFormat: 'absolute',
				calendars: [
					{
						symbol: 'star-o',
						url: 'webcal://www.calendarlabs.com/templates/ical/Germany-Holidays.ics'
					},
					{
						url: 'URL',
						symbol: 'birthday-cake',
						auth: {
						    user: 'USER',
						    pass: 'PW',
						    method: 'basic'
						}
					},
					{
						url: 'URL',
						symbol: 'calendar-check-o',
						auth: {
						    user: 'USER',
						    pass: 'PW',
						    method: 'basic'
						}
					},

					]
			}
		},
@Kugelfang666
Copy link
Author

For the record: I rolled back the default calendar plugin to the previous release (April) an the problem is solved. There seems to be something wrong with the latest release

@Kugelfang666
Copy link
Author

Unfortunately rolling back the calendar module created a new problem. Now the calendar gets stuck at one day. Hence after a fresh boot it correctly shows that a item is due „tomorrow“ but it does not change to „today“ at midnight. In fact the items displayed are stuck at the day of booting

@MichMich
Copy link
Collaborator

We did; t get any other reports of this issue. Have you checked if the timezone is correct?

@Kugelfang666
Copy link
Author

Hi, mhm actually I did, both in MM as well as via SSH in raspy-config...

With regards to the initial problem (one day lag): this was solved by rolling back to the previous version of the calendar module.

The second problem was actually my mistake: I set the module to a rather long fetch interval of twice a day to prevent my Synology which is hosting the calendars to wake up unnecessarily often. Could it be that the fetch interval also governs how often the time indications (tomorrow, today...) are being updated? After decreasing the setting the problem went away.

Maybe it would be worthwhile to introduce two separate values, one for how often the calendar is fetched from the server and a second for how often the interface is being updated.

@stefsims
Copy link
Contributor

stefsims commented Aug 13, 2019

I also have this issue. All day events "today" are show as "tomorrow".
This is only for recurring events. I made a single entry for today (all day, not recurring) and it showed "today".
Using Google Calendar
My config:
{
colored: true,
maximumEntries: 5,
maximumNumberOfDays: 3,
timeFormat: 'absolute',
showEnd: false,
fullDayEventDateFormat: 'dddd',
dateFormat: 'HH:mm ddd',
dateEndFormat: 'HH:mm',
urgency: 0,
getRelative: 8,

@magnuskonze
Copy link

magnuskonze commented Aug 31, 2019

I also recognised this problem.

I'm new to the MagicMirror-Project (tried it this week for the first time), but i already played around with the code:
In calendarfetcher.js line 187 (var dates = rule.between(past, future, true, limitFunction);) all dates are off by 2 hours.
So line 228 (startDate = moment(date);) creates a wrong startDate. When i remove this line everything seems to work fine. I still don't understand why the date has to be recalculated here.

I noticed, that my google calendar has timezone GMT +2 (Berlin), while my raspberry has Europe/Berlin. Should be the same, but it feels like a timezone problem.

Perhaps this helps?

@magnuskonze
Copy link

My "fix" (removing line 228) doesn't work anymore. I can't reproduce the scenario anymore...

Anyway, the problem only occures with recurring fullday events. They are shown one day later.
Recurring events with starting time respectively non-recurring fullday events are working fine.

Btw. those calendar rules seem to use UTC, correct? This would explain, while the dates in line 187 are 2 hours off in my case.

@magnuskonze
Copy link

I switched back to version 2.7.1 and now recurring fullday events seem to work for me.

@Kugelfang666
Copy link
Author

I just ran an full update on my MM and the issue reappeared. After rolling just the calendar module back tu 2.7.1. everything is working fine again.

@ykuzmycz
Copy link

@Kugelfang666 how do you roll back just the calendar module?

@Kugelfang666
Copy link
Author

I just downloaded the folder from an previous release from git

@ykuzmycz
Copy link

I can confirm rolling back just the calendar module to 2.7.1 corrects my reoccurring events (both daily and hourly).

#1803
#1798

@oemel09
Copy link
Contributor

oemel09 commented Jan 2, 2020

I noticed, that this depends on the way the event saves the recurrence rule.
I had my New Years Eve event saved with this rrule:

rrule: RRule {
    _cache: Cache { all: false, before: [], after: [], between: [] },
    origOptions: {
      dtstart: 2000-12-30T23:00:00.000Z,
      freq: 0,
      bymonth: 12,
      bymonthday: 31,
      tzid: undefined
    },
    ...
},

New Years Day event was saved with this rrule:

rrule: RRule {
    _cache: Cache { all: false, before: [], after: [], between: [] },
    origOptions: {
      dtstart: 1999-12-31T23:00:00.000Z,
      freq: 0,
      interval: 1,
      tzid: undefined
    },
    ....
},

In my calendar app they were both displayed correctly.

However after calling the between function the returned date for both events was 2019-12-31T23:00:00.000Z resulting in displaying New Years Eve and New Years Day happening at the same day.

I assume 23:00:00 is because those events are full day events and are saved in UTC as my time zone currently is UTC+1.

@stale
Copy link

stale bot commented Mar 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 3, 2020
@stale stale bot closed this as completed Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants