Current collected state Current
Observed since 20 Oct, 17:55 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
1-line-opening-hours
Simple parser for OpenStreetMap `opening_hours`
Get rid of heavy responses from API when using simple opening hours, by using the OpenStreetMap opening_hours format.
This was first forked from wbkd. The project then aimed to be bigger, so a lot of code has been rewrote and new features added.
It only supports the human readable parts and not this complete crazy overengineered specification.
Mo-Sa 06:00-22:00Mo-Fr 08:00-18:00; Sa 10:00-14:00Mo-Fr 08:00-18:00; Sa,Su 10:00-20:00Mo-Fr 08:00-12:00, We 14:00-18:00Mo-Fr 08:00-12:00, 14:00-18:00Mo-Fr 08:00+Mo-Fr 08:00-01:00Mo-Fr 08:00-18:00; We off24/7npm install 1-line-opening-hours --save
yarn add 1-line-opening-hours
const openingHours = new OpeningHours('Mo-Sa 06:00-22:00');
console.log('Is this open now?', openingHours.isOpenNow());
console.log('Is this open on 2016-10-01 18:00?', openingHours.isOpenOn(new Date('2016-10-01 18:00')));
console.table(openingHours.getTable());
| Method | Description | Return value |
|---|---|---|
isOpenNow() | Check whether the establishment is open now based on the provided opening hour | true or false |
isOpenOn(date: Date) | Same than above for any date | true or false |
getTable() | Get an array of each day and the corresponding opening time | { su: [], mo: ['06:00-22:00'] ... } |
getFullStatusOfToday() | Send more information about the current opening status, the next day that it will be opened... | { open: false openUntil: null, nextReopening: { hour: '11:00', day: 'tu', opensInDay: 0 } |
getFullStatusOfDay(date: Date) | Same than above for any date | { open: false openUntil: null, nextReopening: { hour: '11:00', day: 'tu', opensInDay: 0 } |
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
@types/jestEnvironment{
"local_name": "@types/jest",
"alias": false,
"peer_metadata": null
} | ^26.0.22 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^14.14.37 | development |
jestEnvironment{
"local_name": "jest",
"alias": false,
"peer_metadata": null
} | ^26.6.3 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^2.2.1 | development |
ts-jestEnvironment{
"local_name": "ts-jest",
"alias": false,
"peer_metadata": null
} | ^26.5.4 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^3.3.4000 | development |
yarn-or-npmEnvironment{
"local_name": "yarn-or-npm",
"alias": false,
"peer_metadata": null
} | ^3.0.1 | development |
Source distribution
{
"integrity": "sha512-d01iQN/EeRqDNqdWktRo8ScHc24UFb2ArVx+USfQoEsseyRNU457GwHkuVugAlLxG5mbz/YZX9tMd7uFpdvpSw==",
"shasum": "d577fb646d15987a812eabf0ccbc5ee622255daa",
"tarball": "https://registry.npmjs.org/1-line-opening-hours/-/1-line-opening-hours-0.3.1.tgz",
"fileCount": 6,
"unpackedSize": 31659,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggIO1CRA9TVsSAnZWagAAvqUP/3XFlgpOBYJKgxyl2SEW\nP4Vxa/OUPemi+anWyOB/flfvNqLBT/CK6viknawX0/BEMwr68oBCX44oZAZH\n80X3lNAvnLsYtSUjw8JxLaEe1AectELUYWJgl7EWf9zR6upLrLr+vK5Hs7tV\nzEx3hl17QNpI4Sjp3z495vR6sOKfVGeTbQdtW0UR19rlxxnCnrs/5xEHHgj7\n4jaOrCQY+yOIUMtmxji+reWsPQnw3GHuQ7530n4cCEAqcxPAB5O+JB3F7cfG\ng8EuoApONtnbXHRX/D5CKoL7dL4oHWtSttAROKRbLudo/be61MtGUzG30bYw\nmvQvW1E1d6z48Qz/Nz2Bz+xeo+hJoicaJFTcosmK5JGLfwnzBomkyeR/M4rZ\nngRENDub5I/k8nZPNJa8eNWhVDs+Ftt+Vj655Etcp3+2nALAWEBM5Tkp+yjp\nY0bu3Gk4Ub6PGVbugClbZS2OD36BzHkDP6Mzuzb6SN3eN6ZjO6GI6W2M8fzb\nYwznPQ8WPGbSQuEZXbjGvYYzQbCSv/BnG1xmQt1owNcPJmD/PjUNyufGUms1\nvYLZoaw099xskrZAwArfStmUov3jTetb7Wr112xj/715MGXnLYuaCJH7hCaj\nFjWPTSDmDee6VXCUo8As00Cqh7vgI/UKWb9jDm2ztb/iLcflxiFvj7QvfPoK\nK9ZY\r\n=ONQo\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEQCIDDmYHwO8Hf65pVYGvfqxrT8AUg2Y7/f6TCtVGl8bp5QAiAJ6p9PlpZEHu64lPeE5v5zfPLUtVYgBIHcbtrtn8a1ug=="
}
]
}Shared repository data · GitHub
Observed since 20 Oct, 17:55 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:06309a5727dba10bb5d649bde6accc91bf2dd15be72493660f8dee739e804a3b