You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Robson Pires <or...@gmail.com> on 2014/09/04 12:08:10 UTC

How to use moment.js in Tapestry 5.4

Hi everyone,

I am trying to use moment.js inside of Tapestry 5.4 environment and I got
this error:

Uncaught SyntaxError: Invalid regular expression: /^?erven$|^?vn$/: Nothing
to repeat

To fix it I had to add this:

  configuration.add("mint-moment",
        new JavaScriptModuleConfiguration(momentJs));

as you can see I just change the name of "momen" to "mint-moment" and its
works fine.


Is there any problem regarding the use of this library in Tapestry?


Thanks.

Re: How to use moment.js in Tapestry 5.4

Posted by Chris Mylonas <ch...@opencsta.org>.
I'm no js fiend, but I just added momentjs with an @Import on my layout
component.
It loads fine if that means anything.

@Import(stylesheet = "context:layout/layout.css", library =
"context:assets/js/moment.js")


The automatic cross-browser timezone formatting looks helpful if it does
what I think it does.




On Thu, Sep 4, 2014 at 8:08 PM, Robson Pires <or...@gmail.com> wrote:

> Hi everyone,
>
> I am trying to use moment.js inside of Tapestry 5.4 environment and I got
> this error:
>
> Uncaught SyntaxError: Invalid regular expression: /^?erven$|^?vn$/: Nothing
> to repeat
>
> To fix it I had to add this:
>
>   configuration.add("mint-moment",
>         new JavaScriptModuleConfiguration(momentJs));
>
> as you can see I just change the name of "momen" to "mint-moment" and its
> works fine.
>
>
> Is there any problem regarding the use of this library in Tapestry?
>
>
> Thanks.
>