incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Bourne <carl.bou...@me.com>
Subject Re: Third Party JavaScript libraries
Date Wed, 19 Sep 2012 15:11:54 GMT
Thanks Ryan,

Does this mean I can get access to moments from within may map logic or does it strictly relate
to views only?

On 19 Sep 2012, at 15:39, Ryan Ramage <ryan.ramage@gmail.com> wrote:

> Carl,
> 
> Yes, you sure can. Here is an example view using moment
> 
> https://github.com/datacitizen/water-quality/blob/master/lib/views.js#L44
> 
> The view is a little complicated, but at least you can see a spot
> where moment is being used. Because it is being used in a view, you
> have to have it at a certain spot in your design doc. Your design doc
> should have something like this
> 
> ddoc.views.lib.moment = "// moment.js// version : 1.6.2// author : Tim
> Wood// l...."
> 
> Here is a the design doc, when it is on couch:
> 
> http://nwt.iriscouch.com/_utils/document.html?water-quality/_design/water-quality
> 
> Of course, using a couchapp tool like kanso makes this stuff easier,
> but at least you should get the general idea how it is working.
> 
> Ryan
> 
> 
> 
> 
> On Wed, Sep 19, 2012 at 8:13 AM, Carl Bourne <carl.bourne@me.com> wrote:
>> Hi,
>> 
>> I would like to use the moments.js  http://momentjs.com/ library in my CouchDB map
views.
>> 
>> Would somebody mind explaining if indeed this is possible and the best approach for
adding it.
>> 
>> Best Regards,
>> 
>> Carl


Mime
View raw message