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 |
mockdateEnvironment{
"local_name": "mockdate",
"alias": false,
"peer_metadata": null
} | ^3.0.5 | 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 |
Source distribution
{
"integrity": "sha512-TkMTYhRVU5fUTlvtKqH0/6harWFZboT0Wu1KAzBDdkbpGpcJ4Mk2PsfRlS6cOMgCUF/UvdDCRrRBEPL/HdS2lQ==",
"shasum": "a4fc95956744a6ef740d3dc340aaa8643c2cd43b",
"tarball": "https://registry.npmjs.org/1-line-opening-hours/-/1-line-opening-hours-0.3.2.tgz",
"fileCount": 6,
"unpackedSize": 32393,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghUkiCRA9TVsSAnZWagAAKrUP/Aq1vpUA7iUJ4I/NsuSY\nAc56h9fymvgMcyfrU0uMOlUI0Re27Z4m6bE6j0C03HsUzIyKyVmb03g4iwl4\nhc++LU75jVlkAre4G58MyNWPsRWof2f0TdZKWblLhEW8vSByfr4x7dbOcpc3\nsXWuOBzWajkd5tHmbHHXFSWgJIjaTXb6OCPLP7SUMMLd9S/Nm3aYV78SWz6c\nc8WhU7+oH0plQC3kjMDW1nN8SE0c2K/kcHJMpZsO2i3JxN89VtdeAh+fLy0d\nFBVtrnbeTtnFpXeVLcB3x1xnd0ubt6Tu+ISsiMnGgCHF0wgHt71C2iCQG8xF\nixBY//pdA9A08yVTegkJZuTgnydcdT/zqEZhREFcpu5shhEpAFen+TKh3t9t\n4p/BQNP1/L1otiTdj0mpGK0ptgMjKJ616kakqpgMQ5Xpa4XPJwZsoYi3Gbo5\nB+jqg/uypwIMsQw8GYpM4T4HnP5NwVsiu9ciIyzuODBPzjP1aiN3mtwm1NAB\neKh57dskIu+UG1Ncnv605+i56V7xqfBneRxUpcCjmCzPVjWnEl+114lDMAK/\nll70p9MzO7UIyrohG13aFimtN7ITkxtg30+4N3mQrVbrI4XSrjLgrWPdkNFV\nxYurbmfipyoqnqak4SHp3fOqz+8rQiCLOys5U1OK2Bal1KCEtdor6aya6xzX\nDYly\r\n=QD3S\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIGvrVWFflVBEtCzRv9GE7Mupm67py5s2hZBUZ6kDrOgHAiEApFY/ERaNYTROe3/s/ds2wwhMN7TLQpcSZgwYr00frKY="
}
]
}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:3b795a4a0a99a522a8a69e47342ac4ddb252d7af2d42db7857a4d6abfb8b0c16