You are here

function _datex_date_granularities_supported in Datex 7.2

Checks to see if a field is supported.

If month is present, Then it's supported. But if month is not present then none of smaller granularities should be present either, Otherwise it's imposible to calculate correct date, Since date module sets month to 1.

4 calls to _datex_date_granularities_supported()
datex_date_field_formatter_settings_form_alter in ./datex_date.inc
implements hook_date_field_formatter_settings_form_alter().
datex_date_field_formatter_settings_summary_alter in ./datex_date.inc
implements hook_date_field_formatter_settings_summary_alter().
datex_date_field_widget_settings_form_alter in ./datex_date.inc
Implements hook_date_field_instance_settings_form_alter().
_datex_field_calendar in ./datex_date.inc
Find suitable calendar for field.

File

./datex_date.inc, line 16
Provides Jalali support for date module.

Code

function _datex_date_granularities_supported($g) {
  if (!in_array('month', $g) && count($g) > 1) {
    return FALSE;
  }
  return TRUE;
}