Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
🐛 Update implementation of hour-check for "auto" to properly work
Browse files Browse the repository at this point in the history
  • Loading branch information
acollierr17 committed Dec 2, 2020
1 parent 30740b2 commit 115a791
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ Tags will be separated with a comma, before it was separated with a space.
## Work in progress changes
stay up to date https://trello.com/b/l4zH3Ne2/menudocs-written-guide

- Accent colours
- Stripping Unnecessary code back
- Removal of loading pacman
- Improve Colours on Categories and Tags
- Change Paint Pallete to Cog
- Remove Auto or actually make it work
- Implement "to top" feature directly
- [x] Remove Auto or actually make it work
- [ ] Accent colours
- [ ] Stripping Unnecessary code back
- [ ] Removal of loading pacman
- [ ] Improve Colours on Categories and Tags
- [ ] Change Paint Pallete to Cog
- [ ] Implement "to top" feature directly
13 changes: 7 additions & 6 deletions components/Mode/applyMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export default function applyMode (mode) {
if (isDarkMode) render('dark')
if (isLightMode) render('light')

if (!isDarkMode && !isLightMode) {
console.log('You specified no preference for a color scheme or your browser does not support it. I schedule dark mode during night time.')
const hour = new Date().getHours()
if (hour < 6 || hour >= 18) render('dark')
else render('light')
}
/**
* 6 AM - 6 PM: Light mode
* 6 PM - 5 AM: Dark mode
*/
const hour = new Date().getHours()
if (hour < 6 || hour >= 18) render('dark')
else render('light')
}

0 comments on commit 115a791

Please sign in to comment.