This solution is without the moment.js library.
Between 7 days ago and now
const sevenDaysAgo = new Date(new Date().setDate(new Date().getDate() - 7));
models.instagram.findAll({
  where: {
    my_date: {
      $gt: sevenDaysAgo,
      $lt: new Date(),
    },
  },
});
Between now and 7 days from now
const sevenDaysFromNow = new Date(new Date().setDate(new Date().getDate() + 7));
models.instagram.findAll({
  where: {
    my_date: {
      $gt: new Date(),
      $lt: sevenDaysFromNow,
    },
  },
});
Notes:
- $gtstands for "greater than". You could use- $gteinstead of- $gt.- $gtestands for "greater than or equal to". Same for- $lteof course.
- Technically speaking, you need both $ltand$gtto make sure that the date isn't into the future (per the original question).
- Other answers show the use of [Sequelize.Op.gt]instead of$gt. Use that if on Sequelize v5.