Skip to content

Commit

Permalink
docs(readme): preparing readme doc
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoTron committed Oct 6, 2017
1 parent cc65552 commit b22e2d4
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 15 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@ Business hours javascript lib
[![Travis](https://img.shields.io/travis/littletower/business-hours.js.svg?style=flat-square)]()
[![Codecov](https://img.shields.io/codecov/c/github/littletower/business-hours.js.svg?style=flat-square)]()
[![npm](https://img.shields.io/npm/v/business-hours.js.svg?style=flat-square)]()

# Installation
coming soon

# Configuration
coming soon

# Example
coming soon
102 changes: 102 additions & 0 deletions coverage.lcov
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
TN:
SF:/Users/stefano/Documents/Dev/businessHours/business-hours/src/index.js
FN:19,BusinessHours
FN:37,(anonymous_9)
FN:70,(anonymous_12)
FNF:3
FNH:3
FNDA:1,BusinessHours
FNDA:8,(anonymous_9)
FNDA:8,(anonymous_12)
DA:1,1
DA:2,1
DA:3,1
DA:4,1
DA:5,1
DA:6,1
DA:8,1
DA:19,1
DA:20,1
DA:21,1
DA:25,18
DA:26,17
DA:27,14
DA:28,14
DA:29,14
DA:30,13
DA:33,2
DA:34,2
DA:35,1
DA:37,2
DA:38,8
DA:39,1
DA:41,7
DA:42,6
DA:43,0
DA:44,6
DA:45,0
DA:46,6
DA:47,0
DA:50,6
DA:51,0
DA:59,1
DA:62,3
DA:63,3
DA:65,6
DA:66,6
DA:67,6
DA:68,6
DA:69,6
DA:70,4
DA:71,8
DA:72,8
DA:73,8
DA:74,8
DA:75,8
DA:76,8
DA:77,8
DA:78,8
DA:79,8
DA:84,8
DA:85,8
DA:87,4
DA:111,1
LF:53
LH:49
BRDA:25,0,0,1
BRDA:25,0,1,17
BRDA:26,1,0,3
BRDA:26,1,1,14
BRDA:27,2,0,0
BRDA:27,2,1,14
BRDA:29,3,0,1
BRDA:29,3,1,13
BRDA:34,4,0,1
BRDA:34,4,1,1
BRDA:38,5,0,1
BRDA:38,5,1,7
BRDA:41,6,0,6
BRDA:41,6,1,1
BRDA:42,7,0,0
BRDA:42,7,1,6
BRDA:44,8,0,0
BRDA:44,8,1,6
BRDA:46,9,0,0
BRDA:46,9,1,6
BRDA:50,10,0,0
BRDA:50,10,1,6
BRDA:62,11,0,3
BRDA:62,11,1,0
BRDA:62,12,0,3
BRDA:62,12,1,3
BRDA:65,13,0,6
BRDA:65,13,1,0
BRDA:65,14,0,6
BRDA:65,14,1,6
BRDA:69,15,0,2
BRDA:69,15,1,4
BRDA:85,16,0,2
BRDA:85,16,1,6
BRF:34
BRH:27
end_of_record
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
"main": "dist/index.js",
"scripts": {
"commit": "git-cz",
"report-coverage": "nyc report --reporter=lcov | codecov",
"report-coverage": "nyc report --reporter=text-lcov > coverage.lcov",
"prebuild": "rimraf dist",
"build": "babel --copy-files --out-dir dist --ignore *.test.js src",
"test": "mocha --compilers js:babel-register src/index.test.js -w",
"test:single": "nyc mocha --compilers js:babel-register src/index.test.js",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
"semantic-release":
"semantic-release pre && npm publish && semantic-release post"
},
"babel": {
"presets": [
"es2015",
"stage-2"
]
"presets": ["es2015", "stage-2"]
},
"repository": {
"type": "git",
Expand Down
10 changes: 1 addition & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class BusinessHours {

isOpenNow(now = new Date()) {
const day = getDay(now);
console.log("now: ", format(now, "DD/MM/YYYY HH:mm"));
// console.log("now: ", format(now, "DD/MM/YYYY HH:mm"));
let isOpenNow = false;
if (this.hours[day.toString()] === "closed") return isOpenNow;
this.hours[day.toString()].some((fromTo, index) => {
Expand All @@ -83,14 +83,6 @@ class BusinessHours {
const toDate = setHours(setMinutes(now, toMinutes), toHours);
isOpenNow = isWithinRange(now, fromDate, toDate);

console.log(
"is ",
format(now, "DD/MM/YYYY HH:mm"),
" between ",
format(fromDate, "DD/MM/YYYY HH:mm"),
" - ",
format(toDate, "DD/MM/YYYY HH:mm"),
isOpenNow
);
return isOpenNow;
});
Expand Down

0 comments on commit b22e2d4

Please sign in to comment.