Ver código fonte

forgot some plugin global-attachment

Adam Shaw 6 anos atrás
pai
commit
5449ed5fb4

+ 1 - 2
packages/bootstrap/src/main.ts

@@ -1,4 +1,4 @@
-import { Theme, createPlugin, addDefaultPluginIfGlobal } from '@fullcalendar/core'
+import { Theme, createPlugin } from '@fullcalendar/core'
 import './main.scss'
 
 export class BootstrapTheme extends Theme {
@@ -38,4 +38,3 @@ let plugin = createPlugin({
 })
 
 export default plugin
-addDefaultPluginIfGlobal(plugin)

+ 6 - 2
packages/luxon/src/main.ts

@@ -1,5 +1,5 @@
 import { DateTime as LuxonDateTime, Duration as LuxonDuration } from 'luxon'
-import { Calendar, Duration, NamedTimeZoneImpl, VerboseFormattingArg, createPlugin } from '@fullcalendar/core'
+import { Calendar, Duration, NamedTimeZoneImpl, VerboseFormattingArg, createPlugin, addDefaultPluginIfGlobal } from '@fullcalendar/core'
 
 export function toDateTime(date: Date, calendar: Calendar): LuxonDateTime {
 
@@ -71,11 +71,15 @@ function formatWithCmdStr(cmdStr: string, arg: VerboseFormattingArg) {
   ).toFormat(cmd.whole)
 }
 
-export default createPlugin({
+
+let plugin = createPlugin({
   cmdFormatter: formatWithCmdStr,
   namedTimeZonedImpl: LuxonNamedTimeZone
 })
 
+export default plugin
+addDefaultPluginIfGlobal(plugin)
+
 
 function luxonToArray(datetime: LuxonDateTime): number[] {
   return [

+ 6 - 2
packages/moment/src/main.ts

@@ -1,6 +1,6 @@
 import * as momentNs from 'moment'
 const moment = momentNs as any // the directly callable function
-import { Calendar, Duration, VerboseFormattingArg, createPlugin } from '@fullcalendar/core'
+import { Calendar, Duration, VerboseFormattingArg, createPlugin, addDefaultPluginIfGlobal } from '@fullcalendar/core'
 
 
 export function toMoment(date: Date, calendar: Calendar): momentNs.Moment {
@@ -54,10 +54,14 @@ function formatWithCmdStr(cmdStr: string, arg: VerboseFormattingArg) {
   ).format(cmd.whole) // TODO: test for this
 }
 
-export default createPlugin({
+
+let plugin = createPlugin({
   cmdFormatter: formatWithCmdStr
 })
 
+export default plugin
+addDefaultPluginIfGlobal(plugin)
+
 
 function createMomentFormatFunc(mom: momentNs.Moment) {
   return function(cmdStr) {