Set a date based on a Quarter and Year

Here’s a quick video demonstrating how to use the Custom JavaScript pipe > Moment.js call to set a date field based on what Quarter and Year are set and use that to update a Status field.

Click here to watch the video

You can find the Request code below.

var outputDate;
if('{quarter}'==='Q1'){
     outputDate = moment('{year}-03-31').format('L'); 
} else if ('{quarter}'==='Q2'){
     outputDate = moment('{year}-06-30').format('L'); 
} else if ('{quarter}'==='Q3'){
     outputDate = moment('{year}-09-30').format('L'); 
} else {
     outputDate = moment('{year}-12-31').format('L'); 
}

outputDate
2 Likes