Duration Calculated from a Single Date Field
Hi,
I'm trying to create a calculated field that represents the duration of a meeting to sum the amount of hours used on each project with meetings, for example. I want to register the start-datetime and end-datetime in a single field because I use GoToMeeting sometimes and for the application both dates are needed in the same field. I would not like to have to register two end-datetimes in different fields to make it work.
How can I calculate this in a single field? I can only manage the start-datetime for the moment in the calculations.
Any ideas?
This is the syntax I was trying to use:
calc = moment.duration(@Date Field).asMinutes();
Thank you in advance!
-
Unfortunately only the start date and time are accessible in the calculation field, even if the referenced field has an end date.
On a separate note, to calculate the duration, you could do the following:
moment().diff(moment(@Created On),'days');
This will print the number of days since the item was created.
If you do have a separate end date field, the following:
moment(@DateStart).diff(moment(@DateEnd),'minutes');
would produce the result that you wanted.
-
Hmm this is disappointing news. I was hoping to use the calendar view (week view) to enter into time sheet. The idea was to create the time sheet item with the date field, then stretch the item out in the calendar to have a more graphical view of what was worked on (see image). It would also allow you to see how much of your day was accounted for. However this is kind of useless unless I can calculate the duration of the item for reporting purposes. What I'm reading here means this is impossible to do with calculations correct?
-
Yes, Correct. It's only possible, if you use the extension Globiflow and add an extra date field which is a copy of the end date. Globilfow can copy the end date to this extra date field (when item created or updated). Or you enter the end date manually into this extra field. Then you can use a calculation field for calculating the duration.
Rainer
-
Thanks Rainer.
Can Globiflow calculate the duration and update a duration field instead of having a calculated field to calculate the duration?
If so it would just add some flexibility so the user could enter/update through the calendar view or they could just enter the date and duration without worrying about the calendar view
-
I have use this calculation you shared:
moment().diff(moment(@Created On),'days');
However- is there anything to add so the "days" can add automatically?Meaning, I use this formula to calculate the amount of days have passed since I created this item but the next day it will not add an additional day automatically-
Could you help??
-
Hi @Joline Perez
The reason it doesn't update the next day is because none of the Podio fields referenced in the calculation field have been updated. A calculation field will only update if one of the Podio fields used in the calculation field has changed.
e.g. if you had a single line text field (lets call it "trigger")that you used globiflow to update on a daily basis, then add to your calculation
var useless = @trigger
this variable "useless" would not need to be used anywhere in the calculation. No every time globiflow changes the value of "trigger" the calculation will update.
Please sign in to leave a comment.
Comments
9 comments