Skip to content

Commit 1c85c44

Browse files
Merge pull request #364 from KristjanESPERANTO/main
Release v1.4.4
2 parents 4ab4ffe + e879e9b commit 1c85c44

10 files changed

Lines changed: 965 additions & 3632 deletions

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# http://editorconfig.org
1+
# https://editorconfig.org
22
root = true
33

44
[*]

CALEXT2_Event.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class Event {
193193
let st;
194194
let et;
195195
let sdt;
196-
let edt = null;
196+
let edt;
197197
if (typeof this.dateFormat === "object") {
198198
sd = this.mStart.calendar(null, this.dateFormat);
199199
ed = this.mEnd.calendar(null, this.dateFormat);

CALEXT2_View.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class View {
3939
}
4040

4141
assignEvents(events) {
42-
if (this.config.skipItems === undefined) {
42+
if (!this.config.skipItems) {
4343
this.config.skipItems = 0;
4444
}
4545

CHANGELOG.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
This project adheres to [Semantic Versioning](https://semver.org/).
5+
6+
## [1.4.4] 2024-11-27
7+
8+
- Get rid of callback function `cb`
9+
- Remove useless assignment and unnecessary use of `undefined`
10+
- Simplify nodeVersion
11+
- Optimize logging
12+
- Update dependencies
13+
- Update URL in `.editorconfig`
14+
- Move Changelog from README.md to CHANGELOG.md
15+
- Add link to LICENSE file in README.md
16+
- Fix Update instructions in README.md
17+
18+
## [1.4.3] 2024-10-28 - Maintenance update
19+
20+
- Add linting for Markdown
21+
- Update dependencies
22+
- Add `eslint-plugin-import`
23+
- Remove unused `eslint-plugin-prettier`
24+
- Switch to flat config for prettier and stylelint
25+
26+
## [1.4.2] 2024-08-27 - Maintenance update
27+
28+
- Upgrade ESLint to v9
29+
- Switch to ESLint flat config
30+
- Update dependencies
31+
- Disable validating JavaScript, CSS and JSON by super-linter
32+
33+
## [1.4.1] 2024-01-01 - Maintenance update
34+
35+
- Update dependencies
36+
- Update ESLint env
37+
- Replace eslint-plugin-json by eslint-plugin-jsonc
38+
- Update URLs to MagicMirror project
39+
40+
## [1.4.0] 2023-10-10
41+
42+
- MODIFIED: Replace external package `node-fetch` by internal `fetch` - With this change, node version 18 or newer is required.
43+
44+
## [1.3.0] 2022-03-07
45+
46+
- MODIFIED: Reduction of linting issues #158
47+
48+
## [1.2.0] 2022-02-24
49+
50+
- ADDED: Basic auth support. #138
51+
- MODIFIED: Introduction of Super-Linter and with it a large number of code adjustments (which should have no functional impact). #147
52+
53+
## [1.1.0] 2022-02-11
54+
55+
- ADDED: Vertical Autosizing, Hidden Footer and Space right of items in week/month view #128
56+
- MODIFIED: Replace deprecated package `request` by `node-fetch` #135
57+
- FIXED: `git clone` problem with Windows #137
58+
59+
## [1.0.9] 2020-02-14
60+
61+
- ADDED: `positionOrder` of `view`. now you can change the order of that view in region(position) against other modules.
62+
63+
## [1.0.8] 2020-02-13
64+
65+
- ADDED: `isRecurring` property to `event` object. now you can check this event is recurred or not. You can use this in `filter/sort/transform` callbacks. and CSS class `recurred` will be added to that event.
66+
67+
## [1.0.7] 2020-01-31
68+
69+
- MODIFIED: Default value of `maxItems` to `1000` from `100` to avoid frequently asking issue of `events of nowadays are not shown`
70+
- MODIFIED: Automatically fixing of unofficial URI from `webcal://` URL to `http://`.
71+
72+
## [1.0.6]
73+
74+
- ADDED: `title` of view can have callback function as a value. Now you can make view title contextually
75+
76+
```js
77+
title: "My Weekly",
78+
79+
or
80+
81+
title: (mObj) => { // moment object for first slot of view.
82+
return mObj.format("[My Weekly:] Wo")
83+
},
84+
// This will show "My Weekly: 49TH" as module title.
85+
```
86+
87+
## [1.0.5]
88+
89+
- ADDED: can display name of Month (e.g: August) in `month` view (`monthFormat:"MMMM"`)
90+
91+
## [1.0.4]
92+
93+
- ADDED: event property `ms_busystatus` is added. (Thanks to @klaernie for the PR)
94+
95+
## [1.0.3]
96+
97+
- FIXED: calendar filter is implemented (Sorry, I've totally forgotten it).
98+
99+
## [1.0.2]
100+
101+
- FIXED: not visible in second or followed pages of MMM-pages.
102+
103+
## [1.0.1]
104+
105+
- `view:transform()` is added, now you can modify event value as your wish.

LICENSE renamed to LICENSE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
MIT License
1+
# The MIT License (MIT)
22

3-
Copyright (c) 2018 Seongnoh Sean Yi
3+
- Copyright © 2018-2019 Seongnoh Sean Yi
4+
- Copyright © 2020-2024 Andre Klärner
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ But if you have no dissatisfaction with `MMM-CalendarExt`, leave it.
6464

6565
## Update
6666

67-
Just enter the MMM-PublicTransportHafas directory, pull the update and install the dependencies:
67+
Just enter the MMM-CalendarExt2 directory, pull the update and install the dependencies:
6868

6969
```bash
7070
cd ~/MagicMirror/modules/MMM-CalendarExt2
@@ -74,94 +74,26 @@ npm install
7474

7575
## Changelog
7676

77-
### [1.4.3] 2024-10-28 - Maintenance update
77+
Check the [CHANGELOG](CHANGELOG.md) file for changes.
7878

79-
- Add linting for Markdown
80-
- Update dependencies
81-
- Add `eslint-plugin-import`
82-
- Remove unused `eslint-plugin-prettier`
83-
- Switch to flat config for prettier and stylelint
79+
## License
8480

85-
### [1.4.2] 2024-08-27 - Maintenance update
81+
This module is licensed under the MIT License. Check the [LICENSE](LICENSE.md) file for details.
8682

87-
- Upgrade ESLint to v9
88-
- Switch to ESLint flat config
89-
- Update dependencies
90-
- Disable validating JavaScript, CSS and JSON by super-linter
83+
## Contributing
9184

92-
### [1.4.1] 2024-01-01 - Maintenance update
85+
If you find any problems, bugs or have questions, please [open a GitHub issue](https://github.com/MMM-CalendarExt2/MMM-CalendarExt2/issues) in this repository.
9386

94-
- Update dependencies
95-
- Update ESLint env
96-
- Replace eslint-plugin-json by eslint-plugin-jsonc
97-
- Update URLs to MagicMirror project
87+
Pull requests are of course also very welcome 🙂
9888

99-
### [1.4.0] 2023-10-10
89+
### Developer commands
10090

101-
- MODIFIED: Replace external package `node-fetch` by internal `fetch` - With this change, node version 18 or newer is required.
102-
103-
### [1.3.0] 2022-03-07
104-
105-
- MODIFIED: Reduction of linting issues #158
106-
107-
### [1.2.0] 2022-02-24
108-
109-
- ADDED: Basic auth support. #138
110-
- MODIFIED: Introduction of Super-Linter and with it a large number of code adjustments (which should have no functional impact). #147
111-
112-
### [1.1.0] 2022-02-11
113-
114-
- ADDED: Vertical Autosizing, Hidden Footer and Space right of items in week/month view #128
115-
- MODIFIED: Replace deprecated package `request` by `node-fetch` #135
116-
- FIXED: `git clone` problem with Windows #137
117-
118-
### [1.0.9] 2020-02-14
119-
120-
- ADDED: `positionOrder` of `view`. now you can change the order of that view in region(position) against other modules.
121-
122-
### [1.0.8] 2020-02-13
123-
124-
- ADDED: `isRecurring` property to `event` object. now you can check this event is recurred or not. You can use this in `filter/sort/transform` callbacks. and CSS class `recurred` will be added to that event.
125-
126-
### [1.0.7] 2020-01-31
127-
128-
- MODIFIED: Default value of `maxItems` to `1000` from `100` to avoid frequently asking issue of `events of nowadays are not shown`
129-
- MODIFIED: Automatically fixing of unofficial URI from `webcal://` URL to `http://`.
130-
131-
### [1.0.6]
132-
133-
- ADDED: `title` of view can have callback function as a value. Now you can make view title contextually
134-
135-
```js
136-
title: "My Weekly",
137-
138-
or
139-
140-
title: (mObj) => { // moment object for first slot of view.
141-
return mObj.format("[My Weekly:] Wo")
142-
},
143-
// This will show "My Weekly: 49TH" as module title.
144-
```
145-
146-
### [1.0.5]
147-
148-
- ADDED: can display name of Month (e.g: August) in `month` view (`monthFormat:"MMMM"`)
149-
150-
### [1.0.4]
151-
152-
- ADDED: event property `ms_busystatus` is added. (Thanks to @klaernie for the PR)
153-
154-
### [1.0.3]
155-
156-
- FIXED: calendar filter is implemented (Sorry, I've totally forgotten it).
157-
158-
### [1.0.2]
159-
160-
- FIXED: not visible in second or followed pages of MMM-pages.
161-
162-
### [1.0.1]
163-
164-
- `view:transform()` is added, now you can modify event value as your wish.
91+
- `npm run lint` - Run linting checks.
92+
- `npm run lint:fix` - Fix linting issues.
93+
- `npm run prettier` - Run formatter checks.
94+
- `npm run prettier:fix` - Fix formatter issues.
95+
- `npm run test` - Run linting and formatter checks.
96+
- `npm run release` - Bump version for release.
16597

16698
## MEMO
16799

eslint.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ const config = [
7474
],
7575
"no-plusplus": ["error", {"allowForLoopAfterthoughts": true}],
7676
"no-ternary": "off",
77-
"no-undefined": "warn",
78-
"no-useless-assignment": "warn",
7977
"one-var": "off",
8078
"prefer-destructuring": "off",
8179
"prefer-named-capture-group": "off",

node_helper.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ module.exports = NodeHelper.create({
4242
}
4343
},
4444

45-
async scanCalendar(calendar, cb) {
45+
async scanCalendar(calendar) {
4646
let response;
4747
let data;
4848
Log.log(
4949
`[CALEXT2] calendar:${calendar.name} >> Scanning start with interval:${calendar.scanInterval}`
5050
);
5151

52-
const nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/u)[1]);
52+
const nodeVersion = process.versions.node;
5353
const opts = {
5454
headers: {
5555
"User-Agent": `Mozilla/5.0 (Node.js ${nodeVersion}) MagicMirror/${global.version} (https://github.com/MagicMirrorOrg/MagicMirror/)`
@@ -58,7 +58,7 @@ module.exports = NodeHelper.create({
5858
};
5959

6060
if (calendar.auth && Object.keys(calendar.auth).length > 0) {
61-
if (calendar.auth.password !== undefined) {
61+
if (calendar.auth.password) {
6262
// Just catch people who use password instead of pass
6363
calendar.auth.pass = calendar.auth.password;
6464
}
@@ -96,16 +96,16 @@ module.exports = NodeHelper.create({
9696
}
9797

9898
try {
99-
cb(calendar, data, null);
99+
this.parser(calendar, data, null);
100100
setTimeout(() => {
101-
this.scanCalendar(calendar, cb);
101+
this.scanCalendar(calendar);
102102
}, calendar.scanInterval);
103103
} catch (error) {
104-
cb(calendar, data, error);
105-
Log.error(error);
104+
this.parser(calendar, data, error);
105+
Log.error(`[CALEXT2] Error: ${error}`);
106106

107107
const errorBody = await error.response.text();
108-
Log.error(`Error body: ${errorBody}`);
108+
Log.error(`[CALEXT2] Error body: ${errorBody}`);
109109
}
110110
},
111111

0 commit comments

Comments
 (0)