0.2.1 • Published 2 years ago

binary-booking-calendar v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

binaryBookingCalendar

This is a React Component that contains a calendar together with date/time inputs to allow users to select a time range in which they want to book something.

Usage

  • Install the package using npm install --save binary-booking-calendar or by manually adding it to your package.json
  • Import the component: import Calendar from 'binary-booking-calendar/dist/binaryBookingCalendar'
  • Use it in your code with the properties explained below:
    • bookings An array of already existing bookings formatted like this: {begin: $utcTimeString, end: $utcTimeString}
    • maxBookingLength If bookings cannot be infinitely long, use this to set a max length in milliseconds
    • initialView Either month, 3monnths or asap
    • Hint: You could make this dependent on your users' device size like this: screen.width > 800 ? 'month' : 'asap'
    • getPrice A function that returns a promise which in turn returns the price for the booking timespan. This function should take the date objects bookingBegin and bookingEnd as parameters.
    • handleSubmit A function that submits the booking to your backend. This should also accept the two date objects as well as an optional boolean indicating the booking starts now.

Development

  • Pull this repo
  • Install all dependencies with npm install
  • Start the development server and auto compilation using npm run start
    • Your web browser should open, serving the demo application
    • Note that the calendar was written to be included in an existing design, so styling of the demo app is very bare-bones.

There are a few tests included. You can run those using npm run test.
These tests are also run on every pull request to the main branch so make sure they all pass before creating one.

Current state

While the calendar is in a usable state, it was written in limited time, therefore the code quality may not be the best and there are still quite a few TODOs.

At the moment, there aren't many config options, and the component is only available in German language.
Both of these are supposed to change at some point but no timeframe has been set for this yet.

acceptsacornajvajv-errorsajv-keywordsansi-colorsansi-htmlansi-regexansi-stylesanymatcharr-diffarr-flattenarr-unionarray-flattenarray-unionarray-uniqarray-uniqueassign-symbolsasyncasync-eachasync-limiteratobbabel-plugin-dynamic-import-nodebabel-plugin-polyfill-corejs2babel-plugin-polyfill-corejs3babel-plugin-polyfill-regeneratorbalanced-matchbasebatchbig.jsbinary-extensionsbody-parserbonjourbrace-expansionbracesbrowserslistbuffer-frombuffer-indexofbytescache-basecall-bindcamelcasecaniuse-litechalkchokidarchrome-trace-eventclass-utilscliuiclone-deepcollection-visitcolor-convertcolor-namecolorettecommandercommondircomponent-emittercompressiblecompressionconcat-mapconnect-history-api-fallbackcontent-dispositioncontent-typeconvert-source-mapcookiecookie-signaturecopy-descriptorcore-js-compatcore-util-iscross-spawncssescdebugdecamelizedecode-uri-componentdeep-equaldefault-gatewaydefine-propertiesdefine-propertydeldepddestroydetect-nodedns-equaldns-packetdns-txtee-firstelectron-to-chromiumemoji-regexemojis-listencodeurlend-of-streamenhanced-resolveenvinfoerrnoes-module-lexerescaladeescape-htmlescape-string-regexpeslint-scopeesrecurseestraverseesutilsetageventemitter3eventseventsourceexecaexpand-bracketsexpressextend-shallowextglobfast-deep-equalfast-json-stable-stringifyfastest-levenshteinfaye-websocketfill-rangefinalhandlerfind-cache-dirfind-upfollow-redirectsfor-inforwardedfragment-cachefreshfs.realpathfunction-bindgensyncget-caller-fileget-intrinsicget-streamget-valueglobglob-parentglob-to-regexpglobalsglobbygraceful-fshandle-thinghashas-flaghas-symbolshas-valuehas-valueshpack.jshtml-entitieshttp-deceiverhttp-errorshttp-parser-jshttp-proxyhttp-proxy-middlewarehuman-signalsiconv-liteicss-utilsimport-localinflightinheritsinternal-ipinterpretipip-regexipaddr.jsis-absolute-urlis-accessor-descriptoris-argumentsis-binary-pathis-bufferis-core-moduleis-data-descriptoris-date-objectis-descriptoris-extendableis-extglobis-fullwidth-code-pointis-globis-numberis-path-cwdis-path-in-cwdis-path-insideis-plain-objectis-regexis-streamis-windowsis-wslisarrayisexeisobjectjest-workerjs-tokensjsescjson-parse-better-errorsjson-schema-traversejson3json5killablekind-ofklonaloader-runnerloader-utilslocate-pathlodashlodash.debounceloglevelloose-envifylru-cachemake-dirmap-cachemap-visitmedia-typermemory-fsmerge-descriptorsmerge-streammethodsmicromatchmimemime-dbmime-typesmimic-fnminimalistic-assertminimatchminimistmixin-deepmkdirpmsmulticast-dnsmulticast-dns-service-typesnanoidnanomatchnegotiatorneo-asyncnice-trynode-forgenode-releasesnormalize-pathnpm-run-pathobject-assignobject-copyobject-isobject-keysobject-visitobject.assignobject.pickobufon-finishedon-headersonceonetimeopnoriginalp-finallyp-limitp-locatep-mapp-retryp-tryparseurlpascalcasepath-dirnamepath-existspath-is-absolutepath-is-insidepath-keypath-parsepath-to-regexppicomatchpifypinkiepinkie-promisepkg-dirportfinderposix-character-classespostcsspostcss-modules-extract-importspostcss-modules-local-by-defaultpostcss-modules-scopepostcss-modules-valuespostcss-selector-parserpostcss-value-parserprocess-nextick-argsproxy-addrprrpumppunycodeqsquerystringquerystringifyrandombytesrange-parserraw-bodyreact-isreadable-streamreaddirprechoirregenerateregenerate-unicode-propertiesregenerator-runtimeregenerator-transformregex-notregexp.prototype.flagsregexpu-coreregjsgenregjsparserremove-trailing-separatorrepeat-elementrepeat-stringrequire-directoryrequire-main-filenamerequires-portresolveresolve-cwdresolve-fromresolve-urlretretryrimrafsafe-buffersafe-regexsafer-bufferschema-utilsselect-hoseselfsignedsemversendserialize-javascriptserve-indexserve-staticset-blockingset-valuesetprototypeofshallow-cloneshebang-commandshebang-regexsignal-exitsnapdragonsnapdragon-nodesnapdragon-utilsockjssockjs-clientsource-list-mapsource-mapsource-map-jssource-map-resolvesource-map-supportsource-map-urlspdyspdy-transportsplit-stringstatic-extendstatusesstring_decoderstring-widthstrip-ansistrip-eofstrip-final-newlinesupports-colortapableterserterser-webpack-pluginthunkyto-fast-propertiesto-object-pathto-regexto-regex-rangetoidentifiertype-isunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunion-valueunpipeunset-valueupathuri-jsurixurlurl-parseuseutil-deprecateutils-mergeuuidv8-compile-cachevarywatchpackwbufwebpack-dev-middlewarewebpack-logwebpack-mergewebpack-sourceswebsocket-driverwebsocket-extensionswhichwhich-modulewildcardwrap-ansiwrappywsy18nyallistyargsyargs-parseryocto-queue
0.2.1

2 years ago

0.2.0

2 years ago

0.1.11

2 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago