-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Added css class names "today" and "tomorrow" for calendar #2939
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2939 +/- ##
========================================
Coverage 63.82% 63.82%
========================================
Files 9 9
Lines 293 293
========================================
Hits 187 187
Misses 106 106 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Nice idea, thwnks. would you feel confident writing a test for this feature? |
@rejas I haven't written tests for MagicMirror or node/js before, so not really. I had a quick check and it seems it uses test ics files: https://github.com/MichMich/MagicMirror/tree/master/tests/configs/data |
The trick would be here to change (mock) the date of the system when running the test. Something similar could be either in compliments/weather/calendar tests... |
The last day of a multi-day spliced event did not get today or tomorrow set, fixed now.
@rejas after upgrading npm & node I got the tests to run with: npm run test:e2e |
I think by adding the filename of the test behind the jest call in the nom script in package json |
This worked fine: However when running it on my RPi3b I get this: And after that this: So as much as I like tests, I'm not sure I'll get anywhere with this. |
Yes, adding tests here is not that easy. I opened a ticket for a general solution to this: #2942 And your PR will be merged now, thanks for the work! |
Thanks s lot @rejas |
Added class names "today" and "tomorrow" on the calendar module tr elements (i.e. calendar items).
This way you can for example color your events today and/or tomorrow to more easily see what's happening in the near future.
Implemented by adding an event.tomorrow variable (similar to event.today) that can be used for other things in the future. Also replaced a few hardcoded values (hours, seconds etc.) with constants to make the code more consistent.
Edit: tested with normal events, split day events and events with locations.