mCalendarby László Vajda
mCalendar is a “context-independent” FileMaker calendar / date picker using only global variables.
This version (v3_mFM) requires FileMaker 13.
- it can be implemented in different language environments
- customizable to show weeks starting on Sunday or Monday
- simple setting regulates whether the selection shown is just the day or the week of the date selected.
- separate layout for selecting settings, or
- public “setter” and “getter” scripts to get/set a date and to get/set settings.
- easy to choose month selection (editable popover with language-neutral scripting) speeds up navigation.
- webdirect and iOS ready
Settings can be changed on the fly, no restart or reload is required. Every user can have their own settings, but on first load the default (week starts on Monday, the selection applies to the day) is restored. This can be changed by saving the settings in a field using the ‘Get User Settings’ script and loading it with mCalendar using the ‘Set User Settings’ script when the calendar loads.
The Date Selection
The selection is always a day, regardless of whether only a single day is shown or the whole week. When a day is selected, the month shown always follows. The Back button takes the selection back one step. Look closer and (in the private part of the scripts) you will find the first step to extend this to multiple Back-s.
The ‘Date Selected’ defaults to ‘Today’ when mCalendar loads. Although the ‘Date Selected’ is not modifiable on the layout, the ‘Get Date Selected’ public script will return it for further use, while the ‘Set Date Selected’ public script provides the option to set and show any date in this FileMaker calendar.
The popover is easy to modify to any cultural environment that uses the Gregorian calendar – the scripting relies on month numbers, not names.
Behind the Scenes
Global variables can be accessed (seen and modified) using FileMaker Pro Advanced in Data Viewer. To avoid accidental modifications, every global variable mCalendar relies upon has an “mCalendar_” prefix in its name.
mCalendar, a FileMaker calendar template is released under the terms of the MIT Open Source License.
Do you prefer a calendar based on (global) fields rather than variables? Do you want to use custom functions rather than scripts? Have you created a less boring and not-so-generic interface? Please let me know.