diff options
| author | polo <ordipolo@gmx.fr> | 2025-12-23 21:34:47 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-12-23 21:34:47 +0100 |
| commit | 4f734e0f374428be6424faee0a56458d4fa80396 (patch) | |
| tree | a6fbc52f230a0f048be4ab2db8ac47cfa974f993 /public/js/fullcalendar/packages/luxon1/index.global.js | |
| parent | 833edf6f21aab07dcd0a8d0de9e002c483deed0e (diff) | |
| download | cms-4f734e0f374428be6424faee0a56458d4fa80396.tar.gz cms-4f734e0f374428be6424faee0a56458d4fa80396.tar.bz2 cms-4f734e0f374428be6424faee0a56458d4fa80396.zip | |
installation de fullcalendar avec composer et CDN au lieu de GIT
Diffstat (limited to 'public/js/fullcalendar/packages/luxon1/index.global.js')
| -rw-r--r-- | public/js/fullcalendar/packages/luxon1/index.global.js | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/public/js/fullcalendar/packages/luxon1/index.global.js b/public/js/fullcalendar/packages/luxon1/index.global.js deleted file mode 100644 index 1b3ac69..0000000 --- a/public/js/fullcalendar/packages/luxon1/index.global.js +++ /dev/null | |||
| @@ -1,128 +0,0 @@ | |||
| 1 | /*! | ||
| 2 | FullCalendar Luxon 1 Plugin v6.1.17 | ||
| 3 | Docs & License: https://fullcalendar.io/docs/luxon1 | ||
| 4 | (c) 2024 Adam Shaw | ||
| 5 | */ | ||
| 6 | FullCalendar.Luxon = (function (exports, core, luxon, internal) { | ||
| 7 | 'use strict'; | ||
| 8 | |||
| 9 | function toLuxonDateTime(date, calendar) { | ||
| 10 | if (!(calendar instanceof internal.CalendarImpl)) { | ||
| 11 | throw new Error('must supply a CalendarApi instance'); | ||
| 12 | } | ||
| 13 | let { dateEnv } = calendar.getCurrentData(); | ||
| 14 | return luxon.DateTime.fromJSDate(date, { | ||
| 15 | zone: dateEnv.timeZone, | ||
| 16 | locale: dateEnv.locale.codes[0], | ||
| 17 | }); | ||
| 18 | } | ||
| 19 | function toLuxonDuration(duration, calendar) { | ||
| 20 | if (!(calendar instanceof internal.CalendarImpl)) { | ||
| 21 | throw new Error('must supply a CalendarApi instance'); | ||
| 22 | } | ||
| 23 | let { dateEnv } = calendar.getCurrentData(); | ||
| 24 | return luxon.Duration.fromObject(Object.assign(Object.assign({}, duration), { locale: dateEnv.locale.codes[0] })); | ||
| 25 | } | ||
| 26 | // Internal Utils | ||
| 27 | function luxonToArray(datetime) { | ||
| 28 | return [ | ||
| 29 | datetime.year, | ||
| 30 | datetime.month - 1, | ||
| 31 | datetime.day, | ||
| 32 | datetime.hour, | ||
| 33 | datetime.minute, | ||
| 34 | datetime.second, | ||
| 35 | datetime.millisecond, | ||
| 36 | ]; | ||
| 37 | } | ||
| 38 | function arrayToLuxon(arr, timeZone, locale) { | ||
| 39 | return luxon.DateTime.fromObject({ | ||
| 40 | zone: timeZone, | ||
| 41 | locale, | ||
| 42 | year: arr[0], | ||
| 43 | month: arr[1] + 1, | ||
| 44 | day: arr[2], | ||
| 45 | hour: arr[3], | ||
| 46 | minute: arr[4], | ||
| 47 | second: arr[5], | ||
| 48 | millisecond: arr[6], | ||
| 49 | }); | ||
| 50 | } | ||
| 51 | |||
| 52 | class LuxonNamedTimeZone extends internal.NamedTimeZoneImpl { | ||
| 53 | offsetForArray(a) { | ||
| 54 | return arrayToLuxon(a, this.timeZoneName).offset; | ||
| 55 | } | ||
| 56 | timestampToArray(ms) { | ||
| 57 | return luxonToArray(luxon.DateTime.fromMillis(ms, { | ||
| 58 | zone: this.timeZoneName, | ||
| 59 | })); | ||
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 63 | function formatWithCmdStr(cmdStr, arg) { | ||
| 64 | let cmd = parseCmdStr(cmdStr); | ||
| 65 | if (arg.end) { | ||
| 66 | let start = arrayToLuxon(arg.start.array, arg.timeZone, arg.localeCodes[0]); | ||
| 67 | let end = arrayToLuxon(arg.end.array, arg.timeZone, arg.localeCodes[0]); | ||
| 68 | return formatRange(cmd, start.toFormat.bind(start), end.toFormat.bind(end), arg.defaultSeparator); | ||
| 69 | } | ||
| 70 | return arrayToLuxon(arg.date.array, arg.timeZone, arg.localeCodes[0]).toFormat(cmd.whole); | ||
| 71 | } | ||
| 72 | function parseCmdStr(cmdStr) { | ||
| 73 | let parts = cmdStr.match(/^(.*?)\{(.*)\}(.*)$/); // TODO: lookbehinds for escape characters | ||
| 74 | if (parts) { | ||
| 75 | let middle = parseCmdStr(parts[2]); | ||
| 76 | return { | ||
| 77 | head: parts[1], | ||
| 78 | middle, | ||
| 79 | tail: parts[3], | ||
| 80 | whole: parts[1] + middle.whole + parts[3], | ||
| 81 | }; | ||
| 82 | } | ||
| 83 | return { | ||
| 84 | head: null, | ||
| 85 | middle: null, | ||
| 86 | tail: null, | ||
| 87 | whole: cmdStr, | ||
| 88 | }; | ||
| 89 | } | ||
| 90 | function formatRange(cmd, formatStart, formatEnd, separator) { | ||
| 91 | if (cmd.middle) { | ||
| 92 | let startHead = formatStart(cmd.head); | ||
| 93 | let startMiddle = formatRange(cmd.middle, formatStart, formatEnd, separator); | ||
| 94 | let startTail = formatStart(cmd.tail); | ||
| 95 | let endHead = formatEnd(cmd.head); | ||
| 96 | let endMiddle = formatRange(cmd.middle, formatStart, formatEnd, separator); | ||
| 97 | let endTail = formatEnd(cmd.tail); | ||
| 98 | if (startHead === endHead && startTail === endTail) { | ||
| 99 | return startHead + | ||
| 100 | (startMiddle === endMiddle ? startMiddle : startMiddle + separator + endMiddle) + | ||
| 101 | startTail; | ||
| 102 | } | ||
| 103 | } | ||
| 104 | let startWhole = formatStart(cmd.whole); | ||
| 105 | let endWhole = formatEnd(cmd.whole); | ||
| 106 | if (startWhole === endWhole) { | ||
| 107 | return startWhole; | ||
| 108 | } | ||
| 109 | return startWhole + separator + endWhole; | ||
| 110 | } | ||
| 111 | |||
| 112 | var plugin = core.createPlugin({ | ||
| 113 | name: '@fullcalendar/luxon', | ||
| 114 | cmdFormatter: formatWithCmdStr, | ||
| 115 | namedTimeZonedImpl: LuxonNamedTimeZone, | ||
| 116 | }); | ||
| 117 | |||
| 118 | core.globalPlugins.push(plugin); | ||
| 119 | |||
| 120 | exports["default"] = plugin; | ||
| 121 | exports.toLuxonDateTime = toLuxonDateTime; | ||
| 122 | exports.toLuxonDuration = toLuxonDuration; | ||
| 123 | |||
| 124 | Object.defineProperty(exports, '__esModule', { value: true }); | ||
| 125 | |||
| 126 | return exports; | ||
| 127 | |||
| 128 | })({}, FullCalendar, luxon, FullCalendar.Internal); | ||
