mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
fixes #3701 offset calculation wrong when user looking back at east coast event added testcase
This commit is contained in:
parent
53ac31dcf3
commit
af77b7b628
@ -35,6 +35,7 @@ planned for 2025-04-01
|
|||||||
- [calendar] Fix arrayed symbols, #3267, again, add testcase, add testcase for #3678
|
- [calendar] Fix arrayed symbols, #3267, again, add testcase, add testcase for #3678
|
||||||
- [weather] Fix wrong weatherCondition name in openmeteo provider which lead to n/a icon (#3691)
|
- [weather] Fix wrong weatherCondition name in openmeteo provider which lead to n/a icon (#3691)
|
||||||
- [core] Fix wrong port in log message when starting server only (#3696)
|
- [core] Fix wrong port in log message when starting server only (#3696)
|
||||||
|
- [calendar] NewYork event processed on system in Central timezone shows wrong time #3701
|
||||||
|
|
||||||
## [2.30.0] - 2025-01-01
|
## [2.30.0] - 2025-01-01
|
||||||
|
|
||||||
|
@ -662,9 +662,11 @@ const CalendarFetcherUtils = {
|
|||||||
Log.debug("signs are the same");
|
Log.debug("signs are the same");
|
||||||
if (Math.sign(eventDiff) === -1) {
|
if (Math.sign(eventDiff) === -1) {
|
||||||
//if west, looking at more west
|
//if west, looking at more west
|
||||||
|
// -350 <-300
|
||||||
if (nowDiff < eventDiff) {
|
if (nowDiff < eventDiff) {
|
||||||
//-600 -420
|
//-600 -420
|
||||||
eventDiff = -(eventDiff - (nowDiff - eventDiff)); //-180
|
//300 -300 -360 +300
|
||||||
|
eventDiff = nowDiff - eventDiff; //-180
|
||||||
Log.debug("now looking back east delta diff=", eventDiff);
|
Log.debug("now looking back east delta diff=", eventDiff);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
let config = {
|
||||||
|
address: "0.0.0.0",
|
||||||
|
ipWhitelist: [],
|
||||||
|
|
||||||
|
timeFormat: 24,
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "calendar",
|
||||||
|
position: "bottom_bar",
|
||||||
|
config: {
|
||||||
|
fade: false,
|
||||||
|
urgency: 0,
|
||||||
|
dateFormat: "Do.MMM, HH:mm",
|
||||||
|
fullDayEventDateFormat: "Do.MMM",
|
||||||
|
timeFormat: "absolute",
|
||||||
|
getRelative: 0,
|
||||||
|
maximumNumberOfDays: 28,
|
||||||
|
showEnd: true,
|
||||||
|
calendars: [
|
||||||
|
{
|
||||||
|
maximumEntries: 100,
|
||||||
|
url: "http://localhost:8080/tests/mocks/chicago-nyedge.ics"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
module.exports = config;
|
||||||
|
}
|
@ -253,6 +253,11 @@ describe("Calendar module", () => {
|
|||||||
// just
|
// just
|
||||||
await expect(doTestTableContent(".calendar .event", ".time", "29th.Oct, 05:00-30th.Oct, 18:00", first)).resolves.toBe(true);
|
await expect(doTestTableContent(".calendar .event", ".time", "29th.Oct, 05:00-30th.Oct, 18:00", first)).resolves.toBe(true);
|
||||||
});
|
});
|
||||||
|
it("viewing from further west in diff timezones", async () => {
|
||||||
|
await helpers.startApplication("tests/configs/modules/calendar/chicago-looking-at-ny-recurring.js", "22 Jan 2025 14:30:00 GMT-06:00", [], "America/Chicago");
|
||||||
|
// just
|
||||||
|
await expect(doTestTableContent(".calendar .event", ".time", "22nd.Jan, 17:30-19:30", first)).resolves.toBe(true);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("one event non repeating", () => {
|
describe("one event non repeating", () => {
|
||||||
|
15
tests/mocks/chicago-nyedge.ics
Normal file
15
tests/mocks/chicago-nyedge.ics
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
BEGIN:VEVENT
|
||||||
|
DTSTART;TZID=America/New_York:20240918T183000
|
||||||
|
DTEND;TZID=America/New_York:20240918T203000
|
||||||
|
RRULE:FREQ=WEEKLY;BYDAY=WE
|
||||||
|
EXDATE;TZID=America/New_York:20241127T183000
|
||||||
|
EXDATE;TZID=America/New_York:20241225T183000
|
||||||
|
DTSTAMP:20250122T045443Z
|
||||||
|
UID:_@google.com
|
||||||
|
CREATED:20240916T131843Z
|
||||||
|
LAST-MODIFIED:20241222T235014Z
|
||||||
|
SEQUENCE:0
|
||||||
|
STATUS:CONFIRMED
|
||||||
|
SUMMARY:Derby
|
||||||
|
TRANSP:OPAQUE
|
||||||
|
END:VEVENT
|
Loading…
x
Reference in New Issue
Block a user