Alec Pojidaev's InfoPath Blog
Stuff published for no reason (cool codeless infopath solutions mostly)

Posts Tagged ‘work days

Work (business) days calculations with C#

October 29, 2009

If you think it’s a decent solution vote for it! :)   Work days between 2 dates: public static double GetBusinessDays(DateTime startD, DateTime endD) { double calcBusinessDays = 1 + ((endD-startD).TotalDays * 5 – (startD.DayOfWeek-endD.DayOfWeek) * 2) / 7; if (endD.DayOfWeek == DayOfWeek.Saturday) calcBusinessDays –; if (startD.DayOfWeek == DayOfWeek.Sunday) calcBusinessDays –; return calcBusinessDays; }   Note […]

Infopath codeless programming (walkthrough) 2

December 30, 2008

Other parts: 1, 3. Bookmark that post Tested for SP2007 web forms, SP2010 list and library forms (note: the form has to be redesigned significiantly for list form because of different data fields structure). Updated: 5 more forms added at the bottom: “work days calculation (excluding weekends and holidays)”, “work days calculation in the list […]