Calculation Field "Return Value Types"
Hello!
I've noticed that a calculation field can return a string or a number. Is there a way to set a calculation field so it could return another types of data such as date, duration etc?
I need this because I created an app that calculates a specific date for a specific reason and I would like it (the date) to be shown on a calendar the same way "Date Fields" do.
Thanks,
Eduardo
-
Hi Eduardo,
you can show the date and use it on a calendar. It depends a bit on the format your specific date has but in generall it works like this:
var specDate = your specific date moment(specDate).toDate()
Depending on the format you maybe have to modify this code a bit. But do it in a fresh calculation field. A once saved calculation field keeps its format (number or sting) and this format can't be change. If you try to create in a formatted field it wouldn't work.
Durations are numbers. If you e.g. calculate the difference between 9 am and 3.30pm you get the result 6.5 (the unit you cant set by yourself).
Rainer
Please sign in to leave a comment.
Comments
2 comments