Recently I was asked to develop a project management tool. A major part was a view showing project progress, in particular any "late running" projects.
Projects were broken down into milestones (which had target dates), so each project document had the possibility of having many target dates.
My problem was how to spot a late project from many dates, within a view?
I started off with a massive @if statement, comparing dates and complete fields, which caused all sorts of problems + I knew it was extremely inefficient.. I finally came up with the following code:
The code creates a list of valid dates (Dates), removes the whitespace/blank entries and compares it to todays date. If one or more fail (ie. date is in the past), the down thumb icon is shown.
- This might be a good tip, if we knew the structure before jumping into the code. How many date fields are there, what are their names, or are all dates store in one field... we need to know what the options are before we get thrown into the solution. That was very confusing and to test it on my end, I don't know how many fields to put on the form, named what and what data type they are. Need more details.—Ruth Inman