I am using database folder plugin

What I’m trying to do

I am using database folder plug in , in that facing issue for formula field
I have to fields start date and end date

in formula box i am adding this

${db.js.calculateDuration(row.Start_Date, row.End_Date)}

in js file adding this

function calculateDuration(startDate, endDate) {
if (!startDate || !endDate) {
return null; }
const start = luxon.DateTime.fromISO(startDate);
const end = luxon.DateTime.fromISO(endDate);
if (!start.isValid || !end.isValid) {
return null; }
const duration = end.diff(start, ‘days’).days;
return duration; }
module.exports = calculateDuration;

for linking i placed the file (name : → js.js) in javascript folder
and selecting this folder in formula settings

but this is not working …can anyone help me with this

Try also at the Discussions page of the plugin.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.