-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hello and thank you for wanting to contribute to the MagicMirror² project **Please make sure that you have followed these 4 rules before submitting your Pull Request:** > 1. Base your pull requests against the `develop` branch. DONE ;D > 2. Include these infos in the description: > - Does the pull request solve a **related** issue? NO > - What does the pull request accomplish? Use a list if needed. For calendar entries containing a year (e.g. DOB) in the title, the age can be calculated. Example before: ![grafik](https://github.com/MichMich/MagicMirror/assets/54073894/67ca65f4-24c3-46a8-bee8-0519e4bba3f5) after: ![grafik](https://github.com/MichMich/MagicMirror/assets/54073894/0b4af07d-d3d9-4644-a4a6-e8c402598208) Achieved by adding a new keyword `transform` to customEvents ``` customEvents: [ {keyword: 'Geburtstag', symbol: 'birthday-cake', color: 'Gold', transform: { search: '^([^\']*) \'(\\d{4})$' , replace: '$1 ($2.)', yearmatchgroup: 2}}, {keyword: 'in Hamburg', transform: { search: ' in Hamburg$' , replace: ''}} ], ``` and therewith obsoleting `titleReplace`; a backward compatibility part is already included. If `yearmatchgroup` is unset, behaviour is as in previous code (some additions to which RegExes are accepted, though) If `yearmatchgroup` is set, it is considered the RegEx match group id, which will be used for calculating the age. > - If it includes major visual changes please add screenshots. NO > 3. Please run `npm run lint:prettier` before submitting so that style issues are fixed. DONE > 4. Don't forget to add an entry about your changes to the CHANGELOG.md file. DONE > Thanks again and have a nice day! You too and if any questions, feel free to let me know. --------- Co-authored-by: veeck <[email protected]>
- Loading branch information
1 parent
3a01acd
commit 2a6e2aa
Showing
4 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters