Skip to content

Commit

Permalink
use regulation field, fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
nojhamster committed Jun 7, 2017
1 parent bcf5740 commit 7168ddb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
const monthlyDiff = stringToDuration(getTextOf('#fiche_pointage tfoot .diff'))
const dailyTotal = stringToDuration(getTextOf('#fiche_pointage .jour_courant .champs_temps_theorique'))
const dailyBreak = stringToDuration(getTextOf('#fiche_pointage .jour_courant .champs_pause'))
const regulation = stringToDuration(getTextOf('#fiche_pointage .jour_courant span.regulation'))
const transfered = stringToDuration(getTransferedTime())
const clockings = getClockings()

const now = moment()
const worktime = moment.duration(0)
const remaining = moment.duration(dailyTotal)

if (regulation.isValid()) {
worktime.add(regulation)
}

if (clockings.length > 0) {
clockings.forEach(({ clockIn, clockOut }) => {
if (clockIn && clockOut) {
Expand Down

0 comments on commit 7168ddb

Please sign in to comment.