GithubHelp home page GithubHelp logo

zelzahn / solid-calendar-store Goto Github PK

View Code? Open in Web Editor NEW

This project forked from knowledgeonwebscale/solid-calendar-store

0.0 1.0 0.0 271 KB

Solid stores for managing calendars

TypeScript 100.00%

solid-calendar-store's Introduction

Solid Calendar Store

Solid Calendar is a plugin for CSS. It adds the possibility to perform a list of calendar-based operations. For a concrete overview of all the possible transformations and conversions see docs/.

Initial setup

Make sure to download rmlmapper.jar and place it in the project root. This is not necessary, if the jar isn't there when it's needed it will be downloaded and placed there.

How to run

$ npm i
$ node node_modules/@solid/community-server/bin/server.js -c config.json -m .

See the CSS documentation for more information on what each parameter does.

Disclaimers

  1. Make sure you have the required packages to support typescript compiling installed on your machine.
  2. It is important to run the server from the node module and not from a local version. This is because certain files can only be accessed local (due to how semver works for versions below 1.0.0).

Endpoints

Type Name Used store
GET calendar CalendarStore
GET busy TransformationStore
GET availability AvailabilityStore
GET aggregate AggregateStore
GET transformation TransformationStore

my-settings.yaml

A couple of things are defined in the my-settings.yaml. Firstly the availabilitySlots are defined, furthermore minimumSlotDuration defines the minimum slot dureation (in minutes) of a slot. Both are used in AvailabilityStore.

transformation defines all the possible rules that can be applied. Each rule is of the following format:

[name]:
  match: [regex]
  replace: [string]
  removeFields: [string array]

The name is not unique, i.e. it is possible to define multiple rules with the name "busy" and let them all be applied when navigating to /busy.

Match should be a valid JavaScript regex, excluding the //. It is important that when regex characters are escaped, e.g. \*, the match text is placed in '' and not "".

The string defined in replace will replace all the matched parts.

RemoveFields is an optional string array that defines the to be removed fields of an event. If this line isn't provided only the title, start date and end date are kept.

Holidays

Currently 3 types of holidays are defined:

  1. Constant: Holidays that are always on the same day (example: New Year)
  2. Shifting: Holidays that fall on the nth day of a month (example: Mothers Day)
  3. Fluid: Holidays that aren't exactly possible to be strictly defined (example: Easter)

These are then structured in a json file like this:

{
    "constant": [
        {
            "name": [holiday name],
            "date": {
                "day": [UTC day],
                "month": [UTC month]
            }
        },
    ],
    "shifting": [
        {
            "name": [holiday name],
            "date": {
                "n": [the nth it falls on],
                "weekday": [which UTC weekday],
                "month": [UTC month]
            }
        }
    ],
    "fluid": {
        [holiday name]: [date (incl. year)]
    }
}

See docs/stores.md for places where the holidays are used.

solid-calendar-store's People

Contributors

pheyvaer avatar zelzahn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.