Post

3 followers Follow
1
Avatar

Date Calculations

Hi,

I am attempting to do some date calculations and am having an issue with the outputs.

I have two columns - "quote Submitted" and "AP Required"

The first column will not have a date entry until we have actually prepared a quote for a customer. The second column is where I would like a calculation to take place - which would be 7 days from the date the quote is submitted.

I can get the calculation to work, and for the date in the second column to show up in the calendar - my issue is that for every other customer that does not yet have a quote submitted date, the AP required date is showing Jan 31, 1969. I would only like a date to show in the second column if the user has input a date in the first column. I've attached screen shots of what I'm talking about.

Is what I am asking possible?

Thanks for your time.
Ryan

Ryan Goodale

Please sign in to leave a comment.

6 comments

1
Avatar

Hi Ryan,

var date = @Quote Submitted;
date != null ? moment(date).add(7,'d').toDate() : ""

Maybe an error notification shown in the preview. Ignore it, save the template. 

Rainer

Rainer Grabowski 1 vote
0
Avatar

Thanks for the reply Rainer.......Here are the two errors I came up with - it wouldn't actually allow me to save it - so I'm assuming it's just something small I've done.

Any thoughts on what I've done or, more accurately, what I need to do?

 

Ryan Goodale 0 votes
0
Avatar

Thanks - the issue was that I simply copy/pasted your text in - I had to delete, and then add, @Quote Submitted for it to work.  Thanks very much for your help

 

Ryan

Ryan Goodale 0 votes
0
Avatar

I have a similar question:

Let's say I have a field @Last Contacted Date and I want the difference from that and today's date to prioritize my client follow ups. How do I calculate that? I'm a newbie and dont know Momentum or Javascript. Anyone can help?

Tara 0 votes