How to use moment.js in Tapestry 5.4

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use moment.js in Tapestry 5.4

mr nobody
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: How to use moment.js in Tapestry 5.4

chris@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 <[hidden email]> 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.
>