Duration Calculated from a Single Date Field

Comments

9 comments

  • Sevan B.

    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.

    2
    Comment actions Permalink
  • Kent Watson

    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?

    0
    Comment actions Permalink
  • Rainer Grabowski

    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

    1
    Comment actions Permalink
  • Kent Watson

    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

    0
    Comment actions Permalink
  • Rainer Grabowski

    Hi Kent,

     

    yes, Globiflow can also calculate the duration and update the duration field (Globiflow can update every field, besides the calculation field, of course)

    Rainer

    0
    Comment actions Permalink
  • Kent Watson

    Thanks Rainer,

    Sweet.  Now to upgrade and then work out how to get Globiflow to do it :)

    0
    Comment actions Permalink
  • Rainer Grabowski

    Hi Kent,

    Globiflow has a great community (a Podio Workspace) where you'll always find a helping hand. You'll find the link to the community in the Globiflow help section. 

    Rainer

    0
    Comment actions Permalink
  • Joline Perez

    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??

    0
    Comment actions Permalink
  • Kent Watson

    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.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk