Post

15 followers Follow
12
Avatar

javascript to use Start-Date and End-Date in a Calculation

I am using a calculation field to create titles for items in an app. I know how to insert the date when it's a single date: All of Client Name + " " + Frequency + " " + Type + " " + moment(Time Period).format("YYYY-MM-DD"); but this will only show the start date.

How do I edit the js so that it pulls in the Start Date and End Date (i.e. 01-01-2014 to 31-12-2014)

Thanks, Ann

Ann Donnelly

Please sign in to leave a comment.

16 comments

0
Avatar

Hey Ann,

If I understand your calculation correct you need a second date field to pull the end date. Does it work if you add a second date field to the app?

Sara Høeg Højlund-Rasmussen 0 votes
Comment actions Permalink
1
Avatar

It would work if there were two date fields, and I could do that -- I really just needed the end date anyway, but as the app came with it already this way I'd thought I'd use it.

There must be a way to instruct moments.js to use the Start or End Date. Are there separate field names for these in the database? ie TimePeriod.Start or something like that?

Ann Donnelly 1 vote
Comment actions Permalink
0
Avatar

Unfortunately not, as far as my knowledge goes you'll need to use a second field :(

Sara Høeg Højlund-Rasmussen 0 votes
Comment actions Permalink
2
Avatar

Hi Ann and Sara,

Good suggestion for a feature request: being able to get the end date of a date field. Most times a separate second field for the end date is not handy and unnecessary taking space. Why not giving js the ability using the existing end date? Would be very efficient.

Regards,
Ron

Ron van der Plas 2 votes
Comment actions Permalink
1
Avatar

Hi Sara, is there already an idea when we will be able to reference the end date inside of the calculations?

For now I'm always creating a separate "end date" date field, but this is not an elegant solution.

Sorry that we are asking for something so small. I guess this is what you get when you give us with so much Podio Awesomeness ... Long story short: you've spoiled us too much ;).

Pieterjan M. 1 vote
Comment actions Permalink
0
Avatar

No plans yet. We're currently working on other parts of Podio :)

Sara Høeg Højlund-Rasmussen 0 votes
Comment actions Permalink
2
Avatar

Just to add a little bit of priority to that issue: you can't at the same time do JS on start and end dates, which requires two date fields, and see start and end date as one field extending over time in calendar view, which is only possible if start and end date are set in one and the same date field.

Fritz Feger 2 votes
Comment actions Permalink
3
Avatar

Yeah, this seems like an easy fix if the system is already storing that data somehow. What can be done to get this addressed more quickly?

Jonathan J. Judge 3 votes
Comment actions Permalink
3
Avatar

I second this. While separate fields are great for calculations and relationships they do not show any duration in the calendar. If I had project that was one year long it would show the Start on the 1st Jan and then the End on 31 Dec in the calendar but nothing in between. This then causes problems for resource management as the person assigned to that project does not have their calendar blocked out for 365 days of work assignment and only gets scheduled for 2! The seemingly only (very ugly solution) is to have many dates fields - Start/End, Start, End. Not very elegant at all sadly. I wouldn't even mind if I was able to create a calculation fields for it i.e Start/End, Calc Start (@Min of Start/End), Calc End (@Max of Start/End). The end date is in Podio we know that for sure but how to get at it seems to be puzzle?

The Podio dev team can get at it and display it for us, why can't we?

Isrial Pritchard 3 votes
Comment actions Permalink
0
Avatar

+1 for wanting to use @End_Date in calculation fields!!!

Colin Brown 0 votes
Comment actions Permalink
0
Avatar

Any progress on adding this end date to the calculations area?

Matt Crystal 0 votes
Comment actions Permalink