Since NinjaCal uses global variables to store its results, we do not have to worry about defining fields or records. The NinjaCal script can be access from any context. As long as you have access to the the NinjaCalDisp field from your desired context, NinjaCal should 'just work'.
The logic that drives the calendar widget (the grid thingy) is contained in a single field, "NinjaCal_basic" (or "NinjaCal_tripple" if you're using the 3-month widget). This is a repeating calculation field. Each calendar widget is made up of 42 of these NinjaCal_basic repetitions (cells).
The NinjaCal_basic field will automatically determine the month in focus by looking at the date values stored in the file global $$__NinjaCalBaseDate. NinjaCal_basic defaults to the current date (today) if $$__NinjaCalBaseDate is empty or not valid.
The calendar widget will highlight any dates found in $$__NinjaCalSelectedList. Anytime a date is selected, that selected date or list of dates are stored in $$__NinjaCalSelectedList.
Tip: You can create your own calculation fields that derive values from $$__NinjaCalSelectedList.
This script controls all selection and de-selection behaviors: it sets the $$__NinjaCalBaseDate and $$__NinjaCalSelectedList global variables.
IMPORTANT: Copy this script into your solution BEFORE pasting in any calendar widgets.
Basic syntax is to call the "NinjaCal ( action ; params )" script, and pass it a valid action and the parameters for the action. Parameters separated by carriage returns (these things in FileMaker's calcs: "¶"), so multi-value parameters need to be passed as quoted list. See examples below:
{ } are for optional parameters
selectDate Parameters: datelist, {refocus}
selectRange Parameters: daterange; {refocus}
stepMonth Parameters: the number of months, usually 1 or -1.
goToDate Parameters: a date
clearDates Parameters: none