diff options
Diffstat (limited to 'library/fullcalendar/packages/moment')
-rw-r--r-- | library/fullcalendar/packages/moment/LICENSE.txt | 20 | ||||
-rw-r--r-- | library/fullcalendar/packages/moment/README.md | 8 | ||||
-rw-r--r-- | library/fullcalendar/packages/moment/main.d.ts | 14 | ||||
-rw-r--r-- | library/fullcalendar/packages/moment/main.esm.js | 102 | ||||
-rw-r--r-- | library/fullcalendar/packages/moment/main.js | 110 | ||||
-rw-r--r-- | library/fullcalendar/packages/moment/main.min.js | 6 | ||||
-rw-r--r-- | library/fullcalendar/packages/moment/package.json | 34 |
7 files changed, 0 insertions, 294 deletions
diff --git a/library/fullcalendar/packages/moment/LICENSE.txt b/library/fullcalendar/packages/moment/LICENSE.txt deleted file mode 100644 index 2149cfbef..000000000 --- a/library/fullcalendar/packages/moment/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -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. diff --git a/library/fullcalendar/packages/moment/README.md b/library/fullcalendar/packages/moment/README.md deleted file mode 100644 index 854e4367f..000000000 --- a/library/fullcalendar/packages/moment/README.md +++ /dev/null @@ -1,8 +0,0 @@ - -# FullCalendar Moment Plugin - -A connector to the MomentJS date library - -[View the docs »](https://fullcalendar.io/docs/moment-plugins) - -This package was created from the [FullCalendar monorepo »](https://github.com/fullcalendar/fullcalendar) diff --git a/library/fullcalendar/packages/moment/main.d.ts b/library/fullcalendar/packages/moment/main.d.ts deleted file mode 100644 index cc81dab62..000000000 --- a/library/fullcalendar/packages/moment/main.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Generated by dts-bundle v0.7.3-fork.1 -// Dependencies for this module: -// ../../../../../moment -// ../../../../../@fullcalendar/core - -declare module '@fullcalendar/moment' { - import * as momentNs from 'moment'; - import { Calendar, Duration } from '@fullcalendar/core'; - export function toMoment(date: Date, calendar: Calendar): momentNs.Moment; - export function toDuration(fcDuration: Duration): momentNs.Duration; - const _default: import("@fullcalendar/core").PluginDef; - export default _default; -} - diff --git a/library/fullcalendar/packages/moment/main.esm.js b/library/fullcalendar/packages/moment/main.esm.js deleted file mode 100644 index fb97563f3..000000000 --- a/library/fullcalendar/packages/moment/main.esm.js +++ /dev/null @@ -1,102 +0,0 @@ -/*! -FullCalendar Moment Plugin v4.4.2 -Docs & License: https://fullcalendar.io/ -(c) 2019 Adam Shaw -*/ - -import * as momentNs from 'moment'; -import { createPlugin, Calendar } from '@fullcalendar/core'; - -var moment = momentNs; // the directly callable function -function toMoment(date, calendar) { - if (!(calendar instanceof Calendar)) { - throw new Error('must supply a Calendar instance'); - } - return convertToMoment(date, calendar.dateEnv.timeZone, null, calendar.dateEnv.locale.codes[0]); -} -function toDuration(fcDuration) { - return moment.duration(fcDuration); // moment accepts all the props that fc.Duration already has! -} -function formatWithCmdStr(cmdStr, arg) { - var cmd = parseCmdStr(cmdStr); - if (arg.end) { - var startMom = convertToMoment(arg.start.array, arg.timeZone, arg.start.timeZoneOffset, arg.localeCodes[0]); - var endMom = convertToMoment(arg.end.array, arg.timeZone, arg.end.timeZoneOffset, arg.localeCodes[0]); - return formatRange(cmd, createMomentFormatFunc(startMom), createMomentFormatFunc(endMom), arg.separator); - } - return convertToMoment(arg.date.array, arg.timeZone, arg.date.timeZoneOffset, arg.localeCodes[0]).format(cmd.whole); // TODO: test for this -} -var main = createPlugin({ - cmdFormatter: formatWithCmdStr -}); -function createMomentFormatFunc(mom) { - return function (cmdStr) { - return cmdStr ? mom.format(cmdStr) : ''; // because calling with blank string results in ISO8601 :( - }; -} -function convertToMoment(input, timeZone, timeZoneOffset, locale) { - var mom; - if (timeZone === 'local') { - mom = moment(input); - } - else if (timeZone === 'UTC') { - mom = moment.utc(input); - } - else if (moment.tz) { - mom = moment.tz(input, timeZone); - } - else { - mom = moment.utc(input); - if (timeZoneOffset != null) { - mom.utcOffset(timeZoneOffset); - } - } - mom.locale(locale); - return mom; -} -function parseCmdStr(cmdStr) { - var parts = cmdStr.match(/^(.*?)\{(.*)\}(.*)$/); // TODO: lookbehinds for escape characters - if (parts) { - var middle = parseCmdStr(parts[2]); - return { - head: parts[1], - middle: middle, - tail: parts[3], - whole: parts[1] + middle.whole + parts[3] - }; - } - else { - return { - head: null, - middle: null, - tail: null, - whole: cmdStr - }; - } -} -function formatRange(cmd, formatStart, formatEnd, separator) { - if (cmd.middle) { - var startHead = formatStart(cmd.head); - var startMiddle = formatRange(cmd.middle, formatStart, formatEnd, separator); - var startTail = formatStart(cmd.tail); - var endHead = formatEnd(cmd.head); - var endMiddle = formatRange(cmd.middle, formatStart, formatEnd, separator); - var endTail = formatEnd(cmd.tail); - if (startHead === endHead && startTail === endTail) { - return startHead + - (startMiddle === endMiddle ? startMiddle : startMiddle + separator + endMiddle) + - startTail; - } - } - var startWhole = formatStart(cmd.whole); - var endWhole = formatEnd(cmd.whole); - if (startWhole === endWhole) { - return startWhole; - } - else { - return startWhole + separator + endWhole; - } -} - -export default main; -export { toDuration, toMoment }; diff --git a/library/fullcalendar/packages/moment/main.js b/library/fullcalendar/packages/moment/main.js deleted file mode 100644 index 794bee900..000000000 --- a/library/fullcalendar/packages/moment/main.js +++ /dev/null @@ -1,110 +0,0 @@ -/*! -FullCalendar Moment 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('moment'), require('@fullcalendar/core')) : - typeof define === 'function' && define.amd ? define(['exports', 'moment', '@fullcalendar/core'], factory) : - (global = global || self, factory(global.FullCalendarMoment = {}, global.moment, global.FullCalendar)); -}(this, function (exports, momentNs, core) { 'use strict'; - - var moment = momentNs; // the directly callable function - function toMoment(date, calendar) { - if (!(calendar instanceof core.Calendar)) { - throw new Error('must supply a Calendar instance'); - } - return convertToMoment(date, calendar.dateEnv.timeZone, null, calendar.dateEnv.locale.codes[0]); - } - function toDuration(fcDuration) { - return moment.duration(fcDuration); // moment accepts all the props that fc.Duration already has! - } - function formatWithCmdStr(cmdStr, arg) { - var cmd = parseCmdStr(cmdStr); - if (arg.end) { - var startMom = convertToMoment(arg.start.array, arg.timeZone, arg.start.timeZoneOffset, arg.localeCodes[0]); - var endMom = convertToMoment(arg.end.array, arg.timeZone, arg.end.timeZoneOffset, arg.localeCodes[0]); - return formatRange(cmd, createMomentFormatFunc(startMom), createMomentFormatFunc(endMom), arg.separator); - } - return convertToMoment(arg.date.array, arg.timeZone, arg.date.timeZoneOffset, arg.localeCodes[0]).format(cmd.whole); // TODO: test for this - } - var main = core.createPlugin({ - cmdFormatter: formatWithCmdStr - }); - function createMomentFormatFunc(mom) { - return function (cmdStr) { - return cmdStr ? mom.format(cmdStr) : ''; // because calling with blank string results in ISO8601 :( - }; - } - function convertToMoment(input, timeZone, timeZoneOffset, locale) { - var mom; - if (timeZone === 'local') { - mom = moment(input); - } - else if (timeZone === 'UTC') { - mom = moment.utc(input); - } - else if (moment.tz) { - mom = moment.tz(input, timeZone); - } - else { - mom = moment.utc(input); - if (timeZoneOffset != null) { - mom.utcOffset(timeZoneOffset); - } - } - mom.locale(locale); - return mom; - } - function parseCmdStr(cmdStr) { - var parts = cmdStr.match(/^(.*?)\{(.*)\}(.*)$/); // TODO: lookbehinds for escape characters - if (parts) { - var middle = parseCmdStr(parts[2]); - return { - head: parts[1], - middle: middle, - tail: parts[3], - whole: parts[1] + middle.whole + parts[3] - }; - } - else { - return { - head: null, - middle: null, - tail: null, - whole: cmdStr - }; - } - } - function formatRange(cmd, formatStart, formatEnd, separator) { - if (cmd.middle) { - var startHead = formatStart(cmd.head); - var startMiddle = formatRange(cmd.middle, formatStart, formatEnd, separator); - var startTail = formatStart(cmd.tail); - var endHead = formatEnd(cmd.head); - var endMiddle = formatRange(cmd.middle, formatStart, formatEnd, separator); - var endTail = formatEnd(cmd.tail); - if (startHead === endHead && startTail === endTail) { - return startHead + - (startMiddle === endMiddle ? startMiddle : startMiddle + separator + endMiddle) + - startTail; - } - } - var startWhole = formatStart(cmd.whole); - var endWhole = formatEnd(cmd.whole); - if (startWhole === endWhole) { - return startWhole; - } - else { - return startWhole + separator + endWhole; - } - } - - exports.default = main; - exports.toDuration = toDuration; - exports.toMoment = toMoment; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/library/fullcalendar/packages/moment/main.min.js b/library/fullcalendar/packages/moment/main.min.js deleted file mode 100644 index 39552c279..000000000 --- a/library/fullcalendar/packages/moment/main.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! -FullCalendar Moment Plugin v4.4.2 -Docs & License: https://fullcalendar.io/ -(c) 2019 Adam Shaw -*/ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("moment"),require("@fullcalendar/core")):"function"==typeof define&&define.amd?define(["exports","moment","@fullcalendar/core"],t):t((e=e||self).FullCalendarMoment={},e.moment,e.FullCalendar)}(this,(function(e,t,n){"use strict";var r=t;var a=n.createPlugin({cmdFormatter:function(e,t){var n=function e(t){var n=t.match(/^(.*?)\{(.*)\}(.*)$/);if(n){var r=e(n[2]);return{head:n[1],middle:r,tail:n[3],whole:n[1]+r.whole+n[3]}}return{head:null,middle:null,tail:null,whole:t}}(e);if(t.end){var r=l(t.start.array,t.timeZone,t.start.timeZoneOffset,t.localeCodes[0]),a=l(t.end.array,t.timeZone,t.end.timeZoneOffset,t.localeCodes[0]);return function e(t,n,r,a){if(t.middle){var o=n(t.head),l=e(t.middle,n,r,a),u=n(t.tail),i=r(t.head),d=e(t.middle,n,r,a),f=r(t.tail);if(o===i&&u===f)return o+(l===d?l:l+a+d)+u}var c=n(t.whole),m=r(t.whole);return c===m?c:c+a+m}(n,o(r),o(a),t.separator)}return l(t.date.array,t.timeZone,t.date.timeZoneOffset,t.localeCodes[0]).format(n.whole)}});function o(e){return function(t){return t?e.format(t):""}}function l(e,t,n,a){var o;return"local"===t?o=r(e):"UTC"===t?o=r.utc(e):r.tz?o=r.tz(e,t):(o=r.utc(e),null!=n&&o.utcOffset(n)),o.locale(a),o}e.default=a,e.toDuration=function(e){return r.duration(e)},e.toMoment=function(e,t){if(!(t instanceof n.Calendar))throw new Error("must supply a Calendar instance");return l(e,t.dateEnv.timeZone,null,t.dateEnv.locale.codes[0])},Object.defineProperty(e,"__esModule",{value:!0})}));
\ No newline at end of file diff --git a/library/fullcalendar/packages/moment/package.json b/library/fullcalendar/packages/moment/package.json deleted file mode 100644 index d7571f312..000000000 --- a/library/fullcalendar/packages/moment/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@fullcalendar/moment", - "version": "4.4.2", - "title": "FullCalendar Moment Plugin", - "description": "A connector to the MomentJS date library", - "keywords": [ - "calendar", - "event", - "full-sized" - ], - "homepage": "https://fullcalendar.io/", - "docs": "https://fullcalendar.io/docs/moment-plugins", - "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", - "moment": "^2.24.0" - }, - "main": "main.js", - "module": "main.esm.js", - "unpkg": "main.min.js", - "types": "main.d.ts" -} |