These are chat archives for jescalan/roots

29th
Aug 2015
Michael Kornblum
@michaelkornblum
Aug 29 2015 05:52
@SevereOverfl0w the thing is, how would I use js arguments to sort a js object by one field in ascending or descending order. For example, I want to sort the posts object by date in descending order (latest date first). How would I go about doing this?
Dominic Monroe
@SevereOverfl0w
Aug 29 2015 07:43
@michaelkornblum https://lodash.com/docs#sortBy try passing lodash in your locals :)
Pranz
@Pranz
Aug 29 2015 08:17
@michaelkornblum the power of js
  • var now = new Date()
  • var posts = site.posts.filter(function (post) {return post.date < now;}).sort(function (a,b) {return a.date - b.date;})
that is what i personally have
Dominic Monroe
@SevereOverfl0w
Aug 29 2015 08:37
Too advanced for me.. :p
Jeff Escalante
@jescalan
Aug 29 2015 11:07
looks like a solid solution here :+1:
@brks could you add more detail on how you are producing this error? maybe like a link to a sample project that produces it? this would help a lot!
Michael Kornblum
@michaelkornblum
Aug 29 2015 20:27
Thank you @Pranz. I'm looking at the code, and most of it looks pleasantly straightforward. I'm going to try and look at the code example to see which function does what. If I have any further questions, would you be available?
Pranz
@Pranz
Aug 29 2015 22:16
@michaelkornblum I hang around in this channel alot since I've been using roots alot lately so sure, ping me and I'll probably answer
Cory Simmons
@corysimmons
Aug 29 2015 23:59
@jenius Roots work with PostCSS?