Skip to content

Instantly share code, notes, and snippets.

@jfqd
Created March 26, 2010 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfqd/344770 to your computer and use it in GitHub Desktop.
Save jfqd/344770 to your computer and use it in GitHub Desktop.
// create calendar table - need to be run only once!
FMiCalConnector_Settings( "-createCalendarsTable" )
// list of additional fields for the 'SampleEvents' table
_events_uid, Type=text
_calendar_uid, Type=text
_is_all_day, Type=text
_occurrence, Type=text
_end_date, Type=text
_start_date, Type=text
// some fields need small changes
_id, uncheck 'Prohibit modification of value during data entry'
_id, uncheck 'Serial number'
_id, check 'Calculated value' and enter: FMiCalConnector_GetUUID("")
DateStart, change type to 'Calculation' and enter: GetAsDate ( _start_date )
DateEnd, change type to 'Calculation' and enter: GetAsDate ( _end_date )
TimeStart, change type to 'Calculation' and enter: GetAsTime ( _start_date )
TimeEnd, change type to 'Calculation' and enter: GetAsTime ( _end_date )
// list of additional fields for the 'CalendarInterface' table
CalendarUID, Type=text, Global Storage!
StartDate, Type=text, Global Storage!
EndDate, Type=text, Global Storage!
// new value list for calendar popup
Create a new value list, name it 'Calendars' und check the box 'Use values from field'.
Select the field 'calendar_uid' from the 'Data.Calendars' table occurrence.
Check the box 'Also display values from second field' and select the field 'title'.
Check the box 'Show values only from second field'.
// basic environment settings for FM-iCal-Connector
FMiCalConnector_Settings( "-automaticFieldMapping" ; 1 ) &
FMiCalConnector_Settings( "-dateFormat" ; "%m/%d/%Y" ; "%I:%M %p"; "01/15/2009 01:00 PM" ) &
FMiCalConnector_Settings( "-occurrenceWithTimestamp" ; 1 ) &
FMiCalConnector_Settings( "-setFieldNameForAlarmsTable" ; "table" ; "nil" ) &
FMiCalConnector_Settings( "-setFieldNameForAttendeesTable" ; "table" ; "nil" ) &
FMiCalConnector_Settings( "-setFieldNameForTasksTable" ; "table" ; "nil" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "date_stamp" ; "nil" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "is_detached" ; "nil" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "location" ; "nil" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "url" ; "nil" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "recurrence_type" ; "nil" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "table" ; "SampleEvents" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "id" ; "_id" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "uid" ; "_events_uid" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "title" ; "Summary" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "notes" ; "Description" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "occurrence" ; "_occurrence" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "calendar_uid" ; "_calendar_uid" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "is_all_day" ; "_is_all_day" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "start_date" ; "_start_date" ) &
FMiCalConnector_Settings( "-setFieldNameForEventsTable" ; "end_date" ; "_end_date" ) &
FMiCalConnector_GetCalendars( "" )
// script for getting events from ical
FMiCalConnector_GetEvents(
CalendarInterface::CalendarUID ;
CalendarInterface::StartDate ;
CalendarInterface::EndDate )
// script for creating or updating events in ical
FMiCalConnector_CreateEvent(
Case ( IsEmpty ( SampleEvents::_events_uid ) ; "-new" ; "-update" );
"-this" ;
SampleEvents::_id )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment