Given an amount of days, say 25, convert it into a duration text such as ‘3 Weeks, 4 Days’
C# and F# solutions would both be great if the F# variation offers any improvement over C#.
Edit: The solution should expand past weeks to include months and years. Bonus points for including centuries and so on. Extra bonus if it is somewhat configurable, meaning you can tell the method to exclude the normalization of weeks.
This is a recursive solution. Note that a duration only really makes sense measured against a particular point in time on a given calendar because month and year lengths vary. But here is a simple solution assuming fixed lengths: