class CRM_Core_Form_Date

Constants

DATE_yyyy_mm_dd

Various Date Formats.

DATE_mm_dd_yy

Various Date Formats.

DATE_mm_dd_yyyy

Various Date Formats.

DATE_Month_dd_yyyy

Various Date Formats.

DATE_dd_mon_yy

Various Date Formats.

DATE_dd_mm_yyyy

Various Date Formats.

Methods

static 
buildAllowedDateFormats(CRM_Core_Form $form)

Build the date-format form.

static 
buildDateRange(CRM_Core_Form $form, string $fieldName, int $count = 1, string $from = '_from', string $to = '_to', string $fromLabel = 'From:', bool $required = FALSE, array $operators = array(), string $dateFormat = 'searchDate', bool|string $displayTime = FALSE)

Retrieve the date range - relative or absolute and assign it to the form.

static array
returnDateRangeSelector(CRM_Core_Form $form, string $fieldName, int $count = 1, string $from = '_from', string $to = '_to', string $fromLabel = 'From:', bool $required = FALSE, array $operators = array(), string $dateFormat = 'searchDate', bool $displayTime = FALSE)

Build the date range array that will provide the form option values.

static 
addDateRangeToForm(CRM_Core_Form $form, string $fieldName, array $selector, string $from = '_from', string $to = '_to', string $fromLabel = 'From:', bool $required = FALSE, string $dateFormat = 'searchDate', bool $displayTime = FALSE)

Build the date range - relative or absolute.

Details

at line 46
static buildAllowedDateFormats(CRM_Core_Form $form)

Build the date-format form.

Parameters

CRM_Core_Form $form The form object that we are operating on.

at line 85
static buildDateRange(CRM_Core_Form $form, string $fieldName, int $count = 1, string $from = '_from', string $to = '_to', string $fromLabel = 'From:', bool $required = FALSE, array $operators = array(), string $dateFormat = 'searchDate', bool|string $displayTime = FALSE)

Retrieve the date range - relative or absolute and assign it to the form.

Parameters

CRM_Core_Form $form The form the dates should be added to.
string $fieldName
int $count
string $from
string $to
string $fromLabel
bool $required
array $operators Additional value pairs to add.
string $dateFormat
bool|string $displayTime

at line 126
static array returnDateRangeSelector(CRM_Core_Form $form, string $fieldName, int $count = 1, string $from = '_from', string $to = '_to', string $fromLabel = 'From:', bool $required = FALSE, array $operators = array(), string $dateFormat = 'searchDate', bool $displayTime = FALSE)

Build the date range array that will provide the form option values.

It can be - relative or absolute.

Parameters

CRM_Core_Form $form The form object that we are operating on.
string $fieldName
int $count
string $from
string $to
string $fromLabel
bool $required
array $operators Additional Operator Selections to add.
string $dateFormat
bool $displayTime

Return Value

array Values for Selector

at line 169
static addDateRangeToForm(CRM_Core_Form $form, string $fieldName, array $selector, string $from = '_from', string $to = '_to', string $fromLabel = 'From:', bool $required = FALSE, string $dateFormat = 'searchDate', bool $displayTime = FALSE)

Build the date range - relative or absolute.

Parameters

CRM_Core_Form $form The form object that we are operating on.
string $fieldName
array $selector Array of option values to add.
string $from Label.
string $to
string $fromLabel
bool $required
string $dateFormat
bool $displayTime