Brian Dunning's FileMaker Custom Functions

DayWeekYear2Date ( dayNR ; weekNR ; yearNR )

Turns DayNr. WeekNr. & Year into a Date

  Average rating: 3.9 (49 votes) Log in to vote

Arjen van der Ree   Arjen van der Ree
Maxperts
http://www.maxperts.nl

Share on Facebook Share on Twitter

  Sample input:
DayWeekYear2Date ( 2 , 27 , 2012 )
  Sample output:
02-07-2012

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

In many overviews (calendars e.g.) users want to use week numbers & years to see a set of days (mon - fri). This function makes is easy to translate from week-numbers, years and day-numbers (2=monday ... 6 = friday) to calculate say 5 dates to relate to records/portals in a week view.
I couldn't find anything like this on the internet and it took quite some time and testing to get is to work properly.
[dayNR ; 2 .. 5 (mon - fri) ]
[weekNR ; 1 ... 53*
[yearNR ; any year that Filemaker supports ]

*week-number 53 will goto wk 1 the following year in most cases.

 

Comments

comment   comment, VR
Dec 25, 2011
Couldn't this be simpler? See:
http://www.briandunning.com/cf/229
 
Peter Bouma   Peter Bouma, Amsterdam
Mar 18, 2016
I'm not happy with the declaration of script variables ($...) in this function. They should remain local/private within the Let statement of this CF. One way to mark them as private is to use '~' or '@' (in fact anything different from '$' or '$$') instead of the '$' prefix used here.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: