lib/edit.js
function filterBefore(posts) {
      before = moment(before.replace(/\//g, '-'), 'MM-DD-YYYY', true);
      if (!before.isValid()) {
        console.log(chalk.red('Before date is not valid (expecting `MM-DD-YYYY`), ignoring argument.'));
        return posts;
      }

      return posts.filter(function filterPosts(post) {
        return moment(post.date).isBefore(before);
      });
    }
function filterBefore(posts) {
      before = moment(before.replace(/\//g, '-'), 'MM-DD-YYYY', true);
      if (!before.isValid()) {
        console.log(chalk.red('Before date is not valid (expecting `MM-DD-YYYY`), ignoring argument.'));
        return posts;
      }

      return posts.filter(function filterPosts(post) {
        return moment(post.date).isBefore(before);
      });
    }
function filterBefore ( posts ) { before = moment ( before . replace ( / \/ / g , '-' ) , 'MM-DD-YYYY' , true ) ; if ( ! before . isValid ( ) ) { console . log ( chalk . red ( 'Before date is not valid (expecting `MM-DD-YYYY`), ignoring argument.' ) ) ; return posts ; } return posts . filter ( function filterPosts ( post ) { return moment ( post . date ) . isBefore ( before ) ; } ) ; }
filter the posts using a before date if supplied
filter the posts using a before date if supplied