You are here

function weekdays_bitwise_to_array in Weekdays field 7

Transform bitwise representation of selected days to an array of day codes.

2 calls to weekdays_bitwise_to_array()
weekdays_date_restrictions_allowed_values_page_callback in modules/weekdays_date_restrictions/weekdays_date_restrictions.module
Implements allowed_values_page_callback callback.
weekdays_field_load in ./weekdays.module
Implements hook_field_load().

File

./weekdays.module, line 37

Code

function weekdays_bitwise_to_array($bitwise) {
  $codes = weekdays_codes();
  $array = array();
  foreach ($codes as $daycode => $code) {
    if ($bitwise & $code) {
      $array[$daycode] = $daycode;
    }
  }
  return $array;
}