Are you asking how to do that? If yes, then (even though I am not familiar with moment.js, meaning that there could be more eloquent way to achieve this and there could be also simpler ways to check this using JavaScript core functionality)
Check http://momentjs.com/docs/#/query/is-between/ With that you can check if there timestamp2 is between timestamp1-30min and timestamp1+30min. If this is false then there is at least 30 minutes between the two timestamps (=your test is the negation of the above test case) Hartti On Wed, Feb 25, 2015 at 2:25 PM Satish B <[email protected]> wrote: > I'm using node.js and npm moment.js > > I've 2 dates in the following format: > Thu Feb 25 2015 02:57:08 GMT+0530 (India Standard Time) > Thu Feb 26 2015 03:34:29 GMT+0530 (India Standard Time) > > I need to check if there is at least 30 min difference between the 2 > timigns. > > Moment.js http://momentjs.com/ > > *Thanks ..* > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/fea454b2-2e60-41a1-9a0e-cf8c79d2a73d%40googlegroups.com > <https://groups.google.com/d/msgid/nodejs/fea454b2-2e60-41a1-9a0e-cf8c79d2a73d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAH2ObkracC20ftKU0XyCTLT9nkL9bxzveqidqp31PduVm1RHfg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
