Re: fullcalendar integration

Ilya Obshadko <[email protected]> Sat, 10 Nov 2018 12:53:00 +0200
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAAT_KP+4C1Z_xwe2ETreVTHLg9NR13p42Te-vjhJhSv6B4j9fw@mail.gmail.com>
Solved - it turns out that Tapestry loads its own version of moment.js
which is incompatible with fullcalendar.

This does the trick:

@Contribute(ModuleManager.class)
public static void configureScheduler(MappedConfiguration<String,
Object> configuration,

@Path("classpath:META-INF/assets/scheduler-1.9.4/lib/moment.min.js")
Resource momentJs,

@Path("classpath:META-INF/assets/scheduler-1.9.4/lib/fullcalendar.js")
Resource fullCalendarJs,

@Path("classpath:META-INF/assets/scheduler-1.9.4/scheduler.js")
Resource schedulerJs) {
    configuration.override("moment", new
JavaScriptModuleConfiguration(momentJs));
    configuration.add("fullcalendar", new
JavaScriptModuleConfiguration(fullCalendarJs).dependsOn("moment").exports("fullcalendar"));
}


On Sat, Nov 10, 2018 at 8:53 AM Ilya Obshadko <[email protected]> wrote:

> Anyone tried using fullcalendar with Tapestry 5.4.x?
>
> I'm getting an error 'RequireJS error: define: momentProperties.push is
> not a function'.
> I believe this has something to do with moment.js initialization, but
> can't figure it out.
>
> Searching relevant topics on the web didn't quite help. Any help would be
> appreciated.
>
>
> --
> Ilya Obshadko
>
>
>
>

-- 
Ilya Obshadko