Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4445
  • Last Modified:

MomentJS Check if date has occurred in past

I'm trying to check if a date has occurred in the past using MomentJS

      var isToday = new Date();
      var meetingDate = moment(object["meetingdate"]);
      var weeklySubDays = moment().subtract('days', 7);
      var outCome = isToday + meetingDate > weeklySubDays;

Open in new window

0
brendanlefavre
Asked:
brendanlefavre
1 Solution
 
leakim971PluritechnicianCommented:
var meetingDate = moment(object["meetingdate"]);
var outCome = moment().diff(meetingDate,'day') > 7;

Open in new window


more infos :
http://momentjs.com/docs/#/displaying/difference/
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now