Add appointment management with a calendar
This commit is contained in:
20
lib/fullcalendar/rrule/LICENSE.txt
Normal file
20
lib/fullcalendar/rrule/LICENSE.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2019 Adam Shaw
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
8
lib/fullcalendar/rrule/README.md
Normal file
8
lib/fullcalendar/rrule/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
# FullCalendar RRule Plugin
|
||||
|
||||
A connector to the RRule library, for recurring events
|
||||
|
||||
[View the docs »](https://fullcalendar.io/docs/rrule-plugin)
|
||||
|
||||
This package was created from the [FullCalendar monorepo »](https://github.com/fullcalendar/fullcalendar)
|
||||
9
lib/fullcalendar/rrule/main.d.ts
vendored
Normal file
9
lib/fullcalendar/rrule/main.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Generated by dts-bundle v0.7.3-fork.1
|
||||
// Dependencies for this module:
|
||||
// ../../../../../@fullcalendar/core
|
||||
|
||||
declare module '@fullcalendar/rrule' {
|
||||
const _default: import("@fullcalendar/core").PluginDef;
|
||||
export default _default;
|
||||
}
|
||||
|
||||
121
lib/fullcalendar/rrule/main.esm.js
Normal file
121
lib/fullcalendar/rrule/main.esm.js
Normal file
@@ -0,0 +1,121 @@
|
||||
/*!
|
||||
FullCalendar RRule Plugin v4.4.2
|
||||
Docs & License: https://fullcalendar.io/
|
||||
(c) 2019 Adam Shaw
|
||||
*/
|
||||
|
||||
import { rrulestr, RRule } from 'rrule';
|
||||
import { createPlugin, refineProps, createDuration } from '@fullcalendar/core';
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
var EVENT_DEF_PROPS = {
|
||||
rrule: null,
|
||||
duration: createDuration
|
||||
};
|
||||
var recurring = {
|
||||
parse: function (rawEvent, leftoverProps, dateEnv) {
|
||||
if (rawEvent.rrule != null) {
|
||||
var props = refineProps(rawEvent, EVENT_DEF_PROPS, {}, leftoverProps);
|
||||
var parsed = parseRRule(props.rrule, dateEnv);
|
||||
if (parsed) {
|
||||
return {
|
||||
typeData: parsed.rrule,
|
||||
allDayGuess: parsed.allDayGuess,
|
||||
duration: props.duration
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
expand: function (rrule, framingRange) {
|
||||
// we WANT an inclusive start and in exclusive end, but the js rrule lib will only do either BOTH
|
||||
// inclusive or BOTH exclusive, which is stupid: https://github.com/jakubroztocil/rrule/issues/84
|
||||
// Workaround: make inclusive, which will generate extra occurences, and then trim.
|
||||
return rrule.between(framingRange.start, framingRange.end, true)
|
||||
.filter(function (date) {
|
||||
return date.valueOf() < framingRange.end.valueOf();
|
||||
});
|
||||
}
|
||||
};
|
||||
var main = createPlugin({
|
||||
recurringTypes: [recurring]
|
||||
});
|
||||
function parseRRule(input, dateEnv) {
|
||||
var allDayGuess = null;
|
||||
var rrule;
|
||||
if (typeof input === 'string') {
|
||||
rrule = rrulestr(input);
|
||||
}
|
||||
else if (typeof input === 'object' && input) { // non-null object
|
||||
var refined = __assign({}, input); // copy
|
||||
if (typeof refined.dtstart === 'string') {
|
||||
var dtstartMeta = dateEnv.createMarkerMeta(refined.dtstart);
|
||||
if (dtstartMeta) {
|
||||
refined.dtstart = dtstartMeta.marker;
|
||||
allDayGuess = dtstartMeta.isTimeUnspecified;
|
||||
}
|
||||
else {
|
||||
delete refined.dtstart;
|
||||
}
|
||||
}
|
||||
if (typeof refined.until === 'string') {
|
||||
refined.until = dateEnv.createMarker(refined.until);
|
||||
}
|
||||
if (refined.freq != null) {
|
||||
refined.freq = convertConstant(refined.freq);
|
||||
}
|
||||
if (refined.wkst != null) {
|
||||
refined.wkst = convertConstant(refined.wkst);
|
||||
}
|
||||
else {
|
||||
refined.wkst = (dateEnv.weekDow - 1 + 7) % 7; // convert Sunday-first to Monday-first
|
||||
}
|
||||
if (refined.byweekday != null) {
|
||||
refined.byweekday = convertConstants(refined.byweekday); // the plural version
|
||||
}
|
||||
rrule = new RRule(refined);
|
||||
}
|
||||
if (rrule) {
|
||||
return { rrule: rrule, allDayGuess: allDayGuess };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function convertConstants(input) {
|
||||
if (Array.isArray(input)) {
|
||||
return input.map(convertConstant);
|
||||
}
|
||||
return convertConstant(input);
|
||||
}
|
||||
function convertConstant(input) {
|
||||
if (typeof input === 'string') {
|
||||
return RRule[input.toUpperCase()];
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
export default main;
|
||||
128
lib/fullcalendar/rrule/main.js
Normal file
128
lib/fullcalendar/rrule/main.js
Normal file
@@ -0,0 +1,128 @@
|
||||
/*!
|
||||
FullCalendar RRule Plugin v4.4.2
|
||||
Docs & License: https://fullcalendar.io/
|
||||
(c) 2019 Adam Shaw
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rrule'), require('@fullcalendar/core')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', 'rrule', '@fullcalendar/core'], factory) :
|
||||
(global = global || self, factory(global.FullCalendarRrule = {}, global.rrule, global.FullCalendar));
|
||||
}(this, function (exports, rrule, core) { 'use strict';
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
var EVENT_DEF_PROPS = {
|
||||
rrule: null,
|
||||
duration: core.createDuration
|
||||
};
|
||||
var recurring = {
|
||||
parse: function (rawEvent, leftoverProps, dateEnv) {
|
||||
if (rawEvent.rrule != null) {
|
||||
var props = core.refineProps(rawEvent, EVENT_DEF_PROPS, {}, leftoverProps);
|
||||
var parsed = parseRRule(props.rrule, dateEnv);
|
||||
if (parsed) {
|
||||
return {
|
||||
typeData: parsed.rrule,
|
||||
allDayGuess: parsed.allDayGuess,
|
||||
duration: props.duration
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
expand: function (rrule, framingRange) {
|
||||
// we WANT an inclusive start and in exclusive end, but the js rrule lib will only do either BOTH
|
||||
// inclusive or BOTH exclusive, which is stupid: https://github.com/jakubroztocil/rrule/issues/84
|
||||
// Workaround: make inclusive, which will generate extra occurences, and then trim.
|
||||
return rrule.between(framingRange.start, framingRange.end, true)
|
||||
.filter(function (date) {
|
||||
return date.valueOf() < framingRange.end.valueOf();
|
||||
});
|
||||
}
|
||||
};
|
||||
var main = core.createPlugin({
|
||||
recurringTypes: [recurring]
|
||||
});
|
||||
function parseRRule(input, dateEnv) {
|
||||
var allDayGuess = null;
|
||||
var rrule$1;
|
||||
if (typeof input === 'string') {
|
||||
rrule$1 = rrule.rrulestr(input);
|
||||
}
|
||||
else if (typeof input === 'object' && input) { // non-null object
|
||||
var refined = __assign({}, input); // copy
|
||||
if (typeof refined.dtstart === 'string') {
|
||||
var dtstartMeta = dateEnv.createMarkerMeta(refined.dtstart);
|
||||
if (dtstartMeta) {
|
||||
refined.dtstart = dtstartMeta.marker;
|
||||
allDayGuess = dtstartMeta.isTimeUnspecified;
|
||||
}
|
||||
else {
|
||||
delete refined.dtstart;
|
||||
}
|
||||
}
|
||||
if (typeof refined.until === 'string') {
|
||||
refined.until = dateEnv.createMarker(refined.until);
|
||||
}
|
||||
if (refined.freq != null) {
|
||||
refined.freq = convertConstant(refined.freq);
|
||||
}
|
||||
if (refined.wkst != null) {
|
||||
refined.wkst = convertConstant(refined.wkst);
|
||||
}
|
||||
else {
|
||||
refined.wkst = (dateEnv.weekDow - 1 + 7) % 7; // convert Sunday-first to Monday-first
|
||||
}
|
||||
if (refined.byweekday != null) {
|
||||
refined.byweekday = convertConstants(refined.byweekday); // the plural version
|
||||
}
|
||||
rrule$1 = new rrule.RRule(refined);
|
||||
}
|
||||
if (rrule$1) {
|
||||
return { rrule: rrule$1, allDayGuess: allDayGuess };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function convertConstants(input) {
|
||||
if (Array.isArray(input)) {
|
||||
return input.map(convertConstant);
|
||||
}
|
||||
return convertConstant(input);
|
||||
}
|
||||
function convertConstant(input) {
|
||||
if (typeof input === 'string') {
|
||||
return rrule.RRule[input.toUpperCase()];
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
exports.default = main;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
6
lib/fullcalendar/rrule/main.min.js
vendored
Normal file
6
lib/fullcalendar/rrule/main.min.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*!
|
||||
FullCalendar RRule Plugin v4.4.2
|
||||
Docs & License: https://fullcalendar.io/
|
||||
(c) 2019 Adam Shaw
|
||||
*/
|
||||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("rrule"),require("@fullcalendar/core")):"function"==typeof define&&define.amd?define(["exports","rrule","@fullcalendar/core"],r):r((e=e||self).FullCalendarRrule={},e.rrule,e.FullCalendar)}(this,(function(e,r,t){"use strict";var n=function(){return(n=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var u in r=arguments[t])Object.prototype.hasOwnProperty.call(r,u)&&(e[u]=r[u]);return e}).apply(this,arguments)},u={rrule:null,duration:t.createDuration},l={parse:function(e,l,a){if(null!=e.rrule){var f=t.refineProps(e,u,{},l),o=function(e,t){var u,l=null;if("string"==typeof e)u=r.rrulestr(e);else if("object"==typeof e&&e){var a=n({},e);if("string"==typeof a.dtstart){var f=t.createMarkerMeta(a.dtstart);f?(a.dtstart=f.marker,l=f.isTimeUnspecified):delete a.dtstart}"string"==typeof a.until&&(a.until=t.createMarker(a.until)),null!=a.freq&&(a.freq=i(a.freq)),null!=a.wkst?a.wkst=i(a.wkst):a.wkst=(t.weekDow-1+7)%7,null!=a.byweekday&&(a.byweekday=function(e){if(Array.isArray(e))return e.map(i);return i(e)}(a.byweekday)),u=new r.RRule(a)}if(u)return{rrule:u,allDayGuess:l};return null}(f.rrule,a);if(o)return{typeData:o.rrule,allDayGuess:o.allDayGuess,duration:f.duration}}return null},expand:function(e,r){return e.between(r.start,r.end,!0).filter((function(e){return e.valueOf()<r.end.valueOf()}))}},a=t.createPlugin({recurringTypes:[l]});function i(e){return"string"==typeof e?r.RRule[e.toUpperCase()]:e}e.default=a,Object.defineProperty(e,"__esModule",{value:!0})}));
|
||||
34
lib/fullcalendar/rrule/package.json
Normal file
34
lib/fullcalendar/rrule/package.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "@fullcalendar/rrule",
|
||||
"version": "4.4.2",
|
||||
"title": "FullCalendar RRule Plugin",
|
||||
"description": "A connector to the RRule library, for recurring events",
|
||||
"keywords": [
|
||||
"calendar",
|
||||
"event",
|
||||
"full-sized"
|
||||
],
|
||||
"homepage": "https://fullcalendar.io/",
|
||||
"docs": "https://fullcalendar.io/docs/rrule-plugin",
|
||||
"bugs": "https://fullcalendar.io/reporting-bugs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fullcalendar/fullcalendar.git",
|
||||
"homepage": "https://github.com/fullcalendar/fullcalendar"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Adam Shaw",
|
||||
"email": "arshaw@arshaw.com",
|
||||
"url": "http://arshaw.com/"
|
||||
},
|
||||
"copyright": "2019 Adam Shaw",
|
||||
"peerDependencies": {
|
||||
"@fullcalendar/core": "~4.4.0",
|
||||
"rrule": "^2.6.0"
|
||||
},
|
||||
"main": "main.js",
|
||||
"module": "main.esm.js",
|
||||
"unpkg": "main.min.js",
|
||||
"types": "main.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user