Post

1 follower Follow
0
Avatar

Removing Time from Calculation Field that displays several dates

This is similar to other posts, but I haven't been able to figure it out by looking at other answers. Any help is appreciated!

I have a calculation field that displays the values of several date fields.

This is what I have:

var proprequ = @Proposal Requested Date || "";
var propcompl = @Proposal Completed Date || "";
var installsched = @Install Scheduled Date || "";
var installcompl = @Install Completed Date || "";

'Proposal Requested: '+proprequ+'<br>'+
'Proposal Completed: '+propcompl+'<br>'+
'Install Scheduled: '+installsched+'<br>'+
'Install Completed: '+installcompl+'<br>'

Here is the result:

Proposal Requested: Mon May 06 2019 00:00:00 GMT+0000 (UTC)
Proposal Completed: Mon May 06 2019 00:00:00 GMT+0000 (UTC)
Install Scheduled:
Install Completed:

Here is what I would like it to look like:

Proposal Requested: Mon May 06 2019
Proposal Completed: Mon May 06 2019
Install Scheduled:
Install Completed:

Sara Christensen

Please sign in to leave a comment.

1 comment

0
Avatar

I looked again at similar posts and found this one that helped me get it fixed. 

Here is what my code looks like for each date I want to display:

var proprequ = @Proposal Requested Date ? moment(@Proposal Requested Date).format('MM/DD/YYYY'):'';

'Proposal Requested: '+proprequ+'<br>'+

And here is the result...

If there is a date:

Proposal Requested: 05/06/2019

If there is no date:

Proposal Requested:

Sara Christensen 0 votes
Comment actions Permalink