Version: current

# Class CalendarUtil

Located at calendar_base/code/CalendarUtil.php

## Methods summary

`public static` | # `i18n_date( mixed $char, mixed $ts )`
`public static` | # `SetNeedTranslate( )`
`public static` | # `translate( mixed $str )`
`public static` | # `localize( mixed $start, mixed $end, mixed $key )`
`public static` | # `getMonthsMap( )`
`public static` | # `getDaysMap( )`
`public static` | # `getYearsMap( )`
`public static` | # `getDateFromString( mixed $str )`
`public static` | # `date_info_from_ics( mixed $dtstart, mixed $dtend )`
`public static` | # `getDateFromURL( )`
`public static` | # `get_calendar_for( mixed $url_segment )`
`public static` | # `CollapseDatesAndTimes( mixed $dates )`
`public static` | # `Microformat( mixed $date, mixed $time, mixed $offset = true )`
`public static` | # `getDateString( mixed $start_date, mixed $end_date )` This function is used to write a date range in the common human-readable format on the front end. If the date range spans days within the month, we do not rewrte the month name. If it spans two different months, we write both month names, both days, but do not rewrite the year, etc. Though it appears to break the MVC guidelines, it is a lot cleaner than conducting all of this logic on the frontend. This function is used to write a date range in the common human-readable format on the front end. If the date range spans days within the month, we do not rewrte the month name. If it spans two different months, we write both month names, both days, but do not rewrite the year, etc. Though it appears to break the MVC guidelines, it is a lot cleaner than conducting all of this logic on the frontend.
`public static` | # `differenceInMonths( mixed $dateObj1, mixed $dateObj2 )`
`public` | # `date_sort( mixed & $data )`
`public` | # `date_sort_callback( mixed $a, mixed $b )` Callback used by column_sort Callback used by column_sort

### Magic methods summary

## Constants summary

`string` | `ONE_DAY` | `"OneDay"` | #
`string` | `SAME_MONTH_SAME_YEAR` | `"SameMonthSameYear"` | #
`string` | `DIFF_MONTH_SAME_YEAR` | `"DiffMonthSameYear"` | #
`string` | `DIFF_MONTH_DIFF_YEAR` | `"DiffMonthDiffYear"` | #
`string` | `ONE_DAY_HEADER` | `"OneDayHeader"` | #
`string` | `MONTH_HEADER` | `"MonthHeader"` | #
`string` | `YEAR_HEADER` | `"YearHeader"` | #

## Properties summary

`public static array` | $months_map | #
`public static boolean` | $NeedTranslate | #

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -