Skip to content

Instantly share code, notes, and snippets.

@CosineP
Created March 4, 2018 01:58
Show Gist options
  • Save CosineP/432230ed906de178ee8fca41c64bdbb2 to your computer and use it in GitHub Desktop.
Save CosineP/432230ed906de178ee8fca41c64bdbb2 to your computer and use it in GitHub Desktop.
Make days only affect time periods, not time elapsed
diff --git a/background.js b/background.js
index 2f5db2f..22fab23 100644
--- a/background.js
+++ b/background.js
@@ -354,7 +354,7 @@ function checkTab(id, url, isRepeat) {
// Check time limit
let secsLeftBeforeLimit = Infinity;
- if (onSelectedDay && limitMins && limitPeriod) {
+ if (limitMins && limitPeriod) {
// Compute exact seconds before this time limit expires
secsLeftBeforeLimit = limitMins * 60;
if (timedata[2] == periodStart) {
@@ -562,8 +562,8 @@ function updateTimeData(url, secsOpen, secsFocus) {
// Determine whether we should count time spent on page in
// specified time period (we should only count time on selected
// days -- and in conjunction mode, only within time periods)
- let countTimeSpentInPeriod = days[timedate.getDay()];
- if (countTimeSpentInPeriod && conjMode) {
+ let countTimeSpentInPeriod = true;
+ if (conjMode) {
countTimeSpentInPeriod = false;
// Get number of minutes elapsed since midnight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment