Under Review

Create Sugar Logic addWorkDays Function

I'd like to see an addWorkDays Sugar Logic Function created that would work similar to addDays but it would only add Work Days.  Bonus points if it could take into account the fact that the US has a 5 day work week and some other countries have a 6 day work week.  It would be even more useful if it could take into account Holidays.

  • There is a possibility to detect general workdays (not local exceptions like holidays etc) by using dayofweek($date_field) in a SugarLogic as a part of the calculation.

    The formula returns a value between 0 and 6 where 0 is Sunday and 6 is Saturday. This can be used to see if the date is a general workday or not.

    Hope this helps a bit!

    Bests

    Björn Canales Pfisterer

    Technical Support Manager

    provalida GmbH

  • Hi Justin Kuehlthau,

    nice idea, bust as you mentioned already very difficult to implement because of local preferences and holidays. So some countries work an Sunday, others not, holidays are different from country to country, state to state and even from city to city. Then it must be clear whether the workdays count for the whole installation (international) or only the country of the user or even for the city the user is located.

    I think there is no other possibility to create such a function as custom expression based on a custom module for the adminsitration of the workdays. But that is not targeting the standard. It's high art of customizing.

    Greetings

    Harald Kuske