- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
The Object ::calendar::ical provides the methods for importing and exporting single or multiple calendar items in the ical format (see rfc 2445). Currently only the part of ical is implemented, which is used by the mozilla calendar (Sunbird, or Lightning for Thunderbird).
- Author:
- Gustaf Neumann
Class Relations
::nx::Object create ::xo::ical
Methods (to be applied on the object)
clock_to_iso (scripted, public)
xo::ical clock_to_iso seconds
Convert clock epoch (result from [clock seconds]) into ISO format
- Parameters:
- seconds (required, integer)
- Testcases:
- No testcase defined.
# # Convert clock epoch (result from [clock seconds]) into ISO format # clock format $seconds -format "%Y-%m-%dT%H:%M:%SZ" -gmt 1
clock_to_local_day (scripted, public)
xo::ical clock_to_local_day seconds
Convert clock epoch (result from [clock seconds]) to local day (YearMonthDay)
- Parameters:
- seconds (required, integer)
- Testcases:
- No testcase defined.
# # Convert clock epoch (result from [clock seconds]) to local day (YearMonthDay) # clock format $seconds -format "%Y%m%d"
clock_to_oacstime (scripted, public)
xo::ical clock_to_oacstime seconds
Convert clock epoch (result from [clock seconds]) into time format usually used in OpenACS.
- Parameters:
- seconds (required, integer)
- Testcases:
- No testcase defined.
# # Convert clock epoch (result from [clock seconds]) into time # format usually used in OpenACS. # clock format $seconds -format "%Y-%m-%d %H:%M"
clock_to_utc (scripted, public)
xo::ical clock_to_utc seconds
Convert clock epoch (result from [clock seconds]) into UTC time.
- Parameters:
- seconds (required, integer)
- Testcases:
- No testcase defined.
# # Convert clock epoch (result from [clock seconds]) into UTC time. # clock format $seconds -format "%Y%m%dT%H%M%SZ" -gmt 1
date_time_to_clock (scripted, public)
xo::ical date_time_to_clock date time utc
Convert separate fields date and time with boolean utc flags into clock value in seconds.
- Parameters:
- date (required)
- time (required)
- utc (required)
- Testcases:
- No testcase defined.
# # Convert separate fields date and time with boolean utc flags # into clock value in seconds. # set year [string range $date 0 3] set month [string range $date 4 5] set day [string range $date 6 7] set hour [string range $time 0 1] set min [string range $time 2 3] set sec [string range $time 4 5] set TZ [expr {$utc ? "GMT" : ""}] return [clock scan "$year-$month-$day $hour:$min $TZ"]
dates_valid_p (scripted, public)
xo::ical dates_valid_p -start_date start_date -end_date end_date
A sanity check that the start time is before the end time. This is a rewrite of calendar::item::dates_valid_p, but about 100 times faster.
- Switches:
- -start_date (required)
- -end_date (required)
- Testcases:
- No testcase defined.
# A sanity check that the start time is before the end time. # This is a rewrite of calendar::item::dates_valid_p, but # about 100 times faster. # #my log "$start_date <= $end_date = [expr {[clock scan $start_date] <= [clock scan $end_date]}]" expr {[clock scan $start_date] <= [clock scan $end_date]}
ical_to_text (scripted, public)
xo::ical ical_to_text text
Transform the escaped ical text format to plain text
- Parameters:
- text (required)
- Testcases:
- No testcase defined.
# # Transform the escaped ical text format to plain text # regsub -all {\\(n|N)} $text \n text regsub -all {\\(\\|\;|\,)} $text {\1} text return $text
reflow_content_line (scripted, public)
xo::ical reflow_content_line text
Perform line folding: According to RFC 5545 section 3.1, SHOULD NOT be longer than 75 octets, excluding the line break. https://www.ietf.org/rfc/rfc5545.txt
- Parameters:
- text (required)
- Testcases:
- No testcase defined.
# # Perform line folding: According to RFC 5545 section 3.1, # SHOULD NOT be longer than 75 octets, excluding the line break. # https://www.ietf.org/rfc/rfc5545.txt # if {[string length $text] > 73} { set lines "" while {[string length $text] > 73} { append lines [string range $text 0 73] \r\n " " set text [string range $text 74 end] } append lines $text set text $lines } return $text
tcl_time_to_local_day (scripted, public)
xo::ical tcl_time_to_local_day time
Convert Tcl time stamp into local day format https://tools.ietf.org/html/rfc5545#section-3.3.4
- Parameters:
- time (required)
- Testcases:
- No testcase defined.
# # Convert Tcl time stamp into local day format # https://tools.ietf.org/html/rfc5545#section-3.3.4 # return "VALUE=DATE:[:clock_to_local_day [clock scan $time]]"
tcl_time_to_utc (scripted, public)
xo::ical tcl_time_to_utc time
Convert Tcl time stamp to UTC.
- Parameters:
- time (required)
- Testcases:
- No testcase defined.
# # Convert Tcl time stamp to UTC. # clock format [clock scan $time] -format "%Y%m%dT%H%M%SZ" -gmt 1
text_to_ical (scripted, public)
xo::ical text_to_ical [ -remove_tags on|off ] text
Transform arbitrary text to the escaped ical text format (see rfc 2445)
- Switches:
- -remove_tags (optional, boolean, defaults to
"false"
)
- -remove_tags (optional, boolean, defaults to
- Parameters:
- text (required)
- Testcases:
- No testcase defined.
# # Transform arbitrary text to the escaped ical text format # (see rfc 2445) # if {$remove_tags} { regsub -all {<[^>]+>} $text "" text } regsub -all {(\\|\;|\,)} $text {\\\1} text regsub -all \n $text {\\n} text return $text
utc_to_clock (scripted, public)
xo::ical utc_to_clock utc_time
Convert UTC time to clock seconds.
- Parameters:
- utc_time (required)
- Testcases:
- No testcase defined.
# # Convert UTC time to clock seconds. # clock scan $utc_time -format "%Y%m%dT%H%M%SZ" -gmt 1
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables