Brian Dunning's FileMaker Custom Functions

Calendar ( date_field ; option ; iteration ; x_start_on_monday ; x_highlight_weekends ; holiday_list )

c. 2009-2014 Drewsol. This CF consolidates a simple calendar display and selection tool complete with limitless iterations, highlights, holidays, and tooltips.

  Average rating: 4.0 (44 votes) Log in to vote

Drew Wesley   Drew Wesley - Show more from this author
Drewsol
https://www.drewsol.com

Share on Facebook Share on Twitter

  Sample input:
Calendar ( "6/1/2012" ; "calendar" ; 3 ; "" ; "" ; "" )

Calendar ( "5/28/2012" ; "calendar_highlights" ; "" ; 1 ; 1 ; "included" )

Calendar ( "5/5/2012" ; "tooltip_long" ; 1 ; "" ; "" ; "included" )
  Sample output:
(Shows month of August 2012 in 42 repeating fields. Days outside of August are grayed.)

(Shows 42 repeating fields that highlight the weekend and function-included holidays.)

(Shows tooltip upon mouseover:)
Tuesday, May 5, 2012
Cinco de Mayo

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

c. 2009-2012 Drewsol. This CF consolidates a simple calendar display and selection tool complete with limitless iterations, highlights, holidays, and tooltips.

Detailed instructions and a sample script are included in the CF's header.

ChangeLog:
v2.2 - Example file included posted at http://www.drewsol.com/downloads/fnCalendar.zip , removed trademark, renamed from fnCalendar to Calendar.
v2.1 - Added week of year labels.
v2.0 - Added parameter to optionally start calendar on Monday instead of Sunday.
v1.6 - Added provision for 'globally stored' calendar (no redraw upon layout access), cleaner instructions/commenting. Included lite version (same calculation minus documentation and integrated holiday list).
v1.5 - Added instructions for a single-layer conditional formatting method.
v1.4 - LGPL license added.
v1.3 - Integrated holiday list and calendar highlights transferred from 'condition' to 'statement block' to limit unnecessary code execution.
v1.2 - Optimized for performance. Support for unlimited iterations and previous months. Integrated American holiday list.
v1.1 - Support for three calendar display iterations, holidays, weekends, instructions.
v1.0 - Basic function, field independence, tooltips.

 

Comments

Chris Manton   Chris Manton, London, UK
Jun 7, 2009
This is probably something I'd like to use. But with your copyright I can't. Little point in posting here unless you either remove that or open licence it.
Be nice if you'd do one or the other...
 
Drew Wesley   Drew Wesley, Drewsol
Jun 8, 2009
Feel free to use, distribute, and modify. It's open source.
 
Drew Wesley   Drew Wesley, Drewsol
Jun 8, 2009
Oops, I hit enter after typing "Los".
 
Chris Manton   Chris Manton, London, UK
Jun 9, 2009
Thanks Drew. That's very generous.
 
Bruce Robertson   Bruce Robertson
Feb 5, 2010
Doesn't work; all but first cell empty.
1.5 worked OK.
 
Andrew Butt   Andrew Butt, Los Angeles, CA
Feb 6, 2010
If you're using the global calculation option, you'll need (1) to use the date as a trigger field and (2) the Extend function as noted in Step 3a in the documentation:
Let (
trigger = CAL::Date_G ;
fnCalendar ( Extend ( <date field> ) ; "calendar" ; 1 ; "" ; "" )
)
 
Andrew   Andrew
Aug 9, 2014
You could also use the following in Step 6:
<iteration> & " " & Get(CalculationRepetitionNumber)
 
Andrew   Andrew
Aug 9, 2014
Sorry It should have worked but it didn't
 
Drew Wesley   Drew Wesley, Drewsol
Aug 11, 2014
I just uploaded an example file at http://www.drewsol.com/downloads/fnCalendar.zip
 
Noel   Noel
Jul 13, 2020
Hi Drew, very helpful thank you.

I was hoping to be able to also a calculate the weeks elapsed from a selected date in a repeating field. [0, 1, 2,3 ...##] . I couldn't work out how to achieve this and hoped you may offer some advice.

Thank you
 

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: