Display two dates in calculation using relationship fields e.g. 1922 - 2021
Hi everyone,
I need to show two dates e.g. 1922 - 2021. These dates need to be pulled through from a different app via a calculation field.
Here is the 'People' app with the dates:
I've managed to put the dates together in the 'People' app using calculations using this formula:
But I now need to pull it into another app, 'Memorials', but I cannot get it to display and I think it's because my formula is incorrect, but I've been going round in circles for hours and can't get it working.
Here is the formula I've been trying:
moment(@All of Date of birth.join()).format('YYYY') + " - " + moment(@All of Date of death.join()).format('YYYY')
I think I'm confused with the all date function?
Thanks in advance!
-
I think you need to use the 'new Date()' function.
Try something like this:
```
birth_date = new Date(@All of Date of birth);
birth_year = birth_date.getFullYear();
death_date = new Date(@All of Date of death);
death_year = death_date.getFullYear();
birth_year + " - " + death_year
```
Please sign in to leave a comment.
Comments
1 comment